diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7f3c8671de..86b77f8c6b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,6 +2,7 @@ # Add yourself to the "Definitions by:" list instead. # See https://github.com/DefinitelyTyped/DefinitelyTyped#edit-an-existing-package +/types/a-big-triangle/ @MathiasPaumgarten /types/abbrev/ @BendingBender /types/abs/ @AyaMorisawa /types/absolute/ @AyaMorisawa @@ -10,17 +11,20 @@ /types/accepts/ @bomret @brikou /types/accounting/ @gerich-home @chrisleck /types/ace/ @Diullei +/types/ace-diff/ @innovation-team /types/acl/ @tkQubo /types/acorn/ @RReverser @e-cloud /types/actioncable/ @zhu1230 /types/actions-on-google/ @joelhegg /types/activex-access/ @zspitz /types/activex-adodb/ @zspitz +/types/activex-adox/ @zspitz /types/activex-dao/ @zspitz /types/activex-diskquota/ @zspitz /types/activex-excel/ @zspitz /types/activex-faxcomexlib/ @zspitz /types/activex-infopath/ @zspitz +/types/activex-interop/ @zspitz /types/activex-iwshruntimelibrary/ @zspitz /types/activex-libreoffice/ @zspitz /types/activex-msforms/ @zspitz @@ -36,19 +40,21 @@ /types/activex-vbide/ @zspitz /types/activex-wia/ @zspitz /types/activex-word/ @zspitz -/types/adal-angular/ @unindented +/types/adal-angular/ @unindented @aciccarello /types/add-zero/ @Roaders /types/adm-zip/ @jvilk @abner /types/adone/ @s0m3on3 @maxveres -/types/aframe/ @devpaul @bertoritger +/types/aframe/ @devpaul @bertoritger @twastvedt /types/agenda/ @meirgottlieb @princjef /types/aggregate-error/ @BendingBender /types/alertify/ @jjeffery /types/alexa-sdk/ @petebeegle @hoo29 @pascalwhoop @blforce @rk-7 @alexmalcoci /types/alexa-voice-service/ @dolanmiu /types/algebra.js/ @CaselIT -/types/algoliasearch/ @cbaptiste @haroenv @aherve +/types/algoliasearch/ @cbaptiste @haroenv @aherve @samouss +/types/allure-js-commons/ @zaqqaz /types/alt/ @Shearerbeard +/types/amazon-cognito-auth-js/ @scottescue /types/amazon-product-api/ @MattiLehtinen @alien35 /types/amcharts/ @ldrick /types/amp/ @jewbre @@ -119,7 +125,7 @@ /types/angular-toastr/ @nkovacic @trodi /types/angular-toasty/ @muenchdo /types/angular-tooltips/ @leonard-thieu -/types/angular-translate/ @michelsalib +/types/angular-translate/ @michelsalib @GabrielGil /types/angular-ui-bootstrap/ @xt0rted @ry8806 /types/angular-ui-router/ @michelsalib @matiishyn @mikehaas763 /types/angular-ui-scroll/ @marknadig @@ -136,8 +142,9 @@ /types/animejs/ @A-Babin /types/annyang/ @hisham @theluk /types/ansi-colors/ @rogierschouten +/types/ansi-escapes/ @jacobbubu /types/ansi-regex/ @mvachhar -/types/ansi-styles/ @brynbellomy +/types/ansi-styles/ @brynbellomy @plylrnsdy /types/ansicolors/ @rogierschouten /types/any-db/ @rogierschouten /types/any-db-transaction/ @rogierschouten @@ -146,6 +153,7 @@ /types/apex.js/ @y13i /types/aphrodite/ @asvetliakov /types/api-error-handler/ @tkrotoff +/types/apicache/ @danielsogl /types/apigee-access/ @CasperSkydt /types/apollo-codegen/ @bradleyayers /types/app-root-dir/ @chenyang-biu @@ -156,9 +164,10 @@ /types/appletvjs/ @brainded /types/applicationinsights-js/ @kamilszostak /types/aqb/ @Athenkosi-Mase +/types/arangodb/ @pluma /types/arbiter/ @arash16 -/types/arcgis-js-api/v3/ @Esri -/types/arcgis-js-api/ @Esri +/types/arcgis-js-api/v3/ @Esri @bsvensson +/types/arcgis-js-api/ @Esri @bsvensson /types/arcgis-rest-api/ @JeffJacobson /types/arcgis-to-geojson-utils/ @JeffJacobson /types/archiver/ @dolanmiu @crevil @@ -192,7 +201,12 @@ /types/async.nexttick/ @pyrho /types/asynciterator/ @rubensworks /types/atlaskit__button/ @dijimsta +/types/atlaskit__calendar/ @lstanden +/types/atlaskit__inline-edit/ @lstanden +/types/atlaskit__layer/ @lstanden +/types/atlaskit__single-select/ @lstanden /types/atmosphere.js/ @toedter @Mory1879 @Scipion +/types/atob/ @johngeorgewright /types/atom/ @GlenCFL @smhxx @lierdakil /types/atom-keymap/ @GlenCFL /types/atom-mocha-test-runner/ @GlenCFL @@ -211,12 +225,13 @@ /types/autoprefixer/ @odnamrataizem /types/autosize/ @kingdango @keika299 @NeekSandhu /types/autosuggest-highlight/ @senukartur -/types/awesomplete/ @webbiesdk @bmdixon @tbekolay +/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 +/types/aws-lambda/ @skarum @tobyhede @buggy @y13i @wwwy3y3 @OrthoDex @MichaelMarner @daniel-cottone @kostya-misura @coderbyheart @palmithor @daniloraisi @simonbuchan @Haydabase @repl-chris @aneilbaboo /types/aws-serverless-express/ @threesquared @jcaffey @mattmeye @albertovasquez /types/aws4/ @ajcrites /types/axel/ @ruslan-molodyko +/types/axon/ @jewbre /types/azure/ @AndrewGaspar @antiveeranna @SomaticIT /types/azure-mobile-services-client/ @dmorosinotto /types/azure-sb/ @Azure @@ -254,6 +269,7 @@ /types/base-64/ @dolanmiu /types/base-x/ @chrootsu /types/base16/ @alechill +/types/base64-arraybuffer/ @jbencook /types/base64-js/ @pe8ter /types/base64-url/ @urish /types/base64topdf/ @lucasriondel @@ -262,10 +278,11 @@ /types/basic-auth/ @moonpyk @vesse /types/batch-stream/ @drudge /types/bazinga-translator/ @alexndlm -/types/bcrypt/ @codeanimal @IOAyman +/types/bcrypt/ @codeanimal @IOAyman @dstapleton92 /types/bcryptjs/ @RafaelKr /types/beats/ @urish /types/bech32/ @micksatana +/types/behavior3/ @carrrywu /types/bell/ @SimonSchick /types/bem-cn/ @selkinvitaly /types/better-curry/ @pocesar @@ -273,6 +290,7 @@ /types/bezier-easing/ @ptlis /types/bezier-js/ @danmarshall /types/bgiframe/ @sumegizoltan +/types/bidirectional-map/ @helenanderson /types/big.js/ @nycdotnet @googol /types/bigi/ @mhegazy /types/bigint/ @Evgenus @@ -286,7 +304,7 @@ /types/bip38/ @micksatana /types/bip39/ @micksatana /types/bit-array/ @mudkipme -/types/bitcoinjs-lib/ @mhegazy @dlebrecht @rbuckton @micksatana @youssefgh +/types/bitcoinjs-lib/ @mhegazy @dlebrecht @rbuckton @micksatana @youssefgh @kento1218 /types/bitcore-lib/ @lautarodragan /types/bittorrent-protocol/ @feross @tlaziuk /types/bitwise-xor/ @rogierschouten @@ -298,6 +316,8 @@ /types/blob-stream/ @erichillah /types/blob-to-buffer/ @nrlquaker /types/blob-util/ @WorldMaker +/types/blocked/ @l-jonas +/types/blockies/ @LogvinovLeon /types/blocks/ @ksmigiel /types/bloomfilter/ @slawiko /types/blue-tape/ @sodatea @@ -307,7 +327,9 @@ /types/bluebird-global/ @d-ph /types/bluebird-retry/ @pvomhoff /types/blueimp-md5/ @rmartone @mkohlmyr -/types/body-parser/ @santialbo @vilic @dreampulse @blendsdk @tlaziuk +/types/bn.js/ @LogvinovLeon +/types/body-parser/ @santialbo @vilic @dreampulse @blendsdk @tlaziuk @jwalton +/types/body-parser-xml/ @tbounsiar /types/bonjour/ @quentin-ol @octo-sniffle /types/bookshelf/ @arcticwaters @vesse /types/boom/v3/ @rogatty @@ -350,10 +372,11 @@ /types/browser-pack/ @TeamworkGuy2 /types/browser-report/ @JTOne123 /types/browser-resolve/ @marionebl -/types/browser-sync/ @joeskeen +/types/browser-sync/ @joeskeen @aznnomness /types/browserify/ @AndrewGaspar @jvilk @leonard-thieu /types/bs58/ @chrootsu /types/bson/ @horiuchi @CaselIT +/types/btoa/ @johngeorgewright /types/bucks/ @zaneli /types/buffer-compare/ @chrootsu /types/buffer-equal/ @Bartvds @@ -404,7 +427,7 @@ /types/cbor/ @pushplay /types/ccap/ @taoqf /types/chai/v2/ @Bartvds @AGBrown -/types/chai/ @jedmao @Bartvds @AGBrown @olivr70 @mwistrand @joshuakgoldberg @shaunluttin @Naktibalda @micksatana +/types/chai/ @jedmao @Bartvds @AGBrown @olivr70 @mwistrand @joshuakgoldberg @shaunluttin @Naktibalda @micksatana @ErikSchierboom /types/chai-arrays/ @clementprevot /types/chai-as-promised/ @jt000 @Kuniwak @leonard-thieu @lazerwalker @mattbishop /types/chai-datetime/ @cliffburger @@ -419,14 +442,16 @@ /types/chai-spies/ @kuzn-ilya /types/chai-string/ @nmalaguti /types/chai-subset/ @delta62 @AGBrown +/types/chai-uuid/ @harm-less /types/chai-webdriverio/ @sherlock1982 /types/chai-xml/ @jedigo /types/chance/ @cbowdon @brikou @cafesanu /types/change-emitter/ @iskandersierra +/types/chardet/ @Gebatzens /types/charm/ @Xananax /types/charset/ @cspotcode -/types/chart.js/ @anuti @FabienLavocat @KentarouTakeda @larrybahr @mernen @josefpaij @danmana @guillaume-ro-fr @chicoxyzzy -/types/chartist/ @mtgibbs @psimonski @clottman +/types/chart.js/ @anuti @FabienLavocat @KentarouTakeda @larrybahr @mernen @josefpaij @danmana @guillaume-ro-fr @chicoxyzzy @archy-bold @braincore +/types/chartist/ @mtgibbs @psimonski @clottman @affilnost /types/chayns/ @HenningKuehl /types/check-sum/ @BendingBender /types/check-types/ @idchlife @@ -441,9 +466,11 @@ /types/chroma-js/v0/ @invliD /types/chroma-js/ @invliD @mpacholec /types/chrome/ @matthewkimber @otiai10 @couven92 @rreverser @sreimer15 +/types/chromedriver/ @pe8ter /types/circuit-breaker-js/ @DeTeam /types/circular-json/ @jpevarnek -/types/ckeditor/ @wittwert +/types/ckeditor/v2/ @wittwert +/types/ckeditor/ @wittwert @stuartlong /types/clamp-js/ @Hikariii /types/clamp-js-main/ @sinziananicolae /types/classnames/ @adidahiya @JKillian @seansfkelley @mradamczyk @marvinhagemeister @@ -458,15 +485,21 @@ /types/cleave.js/ @clentfort @jasongi-at-sportsbet @sashashakun /types/cli/ @kayahr /types/cli-color/ @ChaosinaCan +/types/cli-progress/ @mhegazy /types/cli-spinner/ @janslow +/types/cli-table/ @arylo /types/cli-table2/ @mgroenhoff /types/client-sessions/ @netroy +/types/clientjs/ @icopp /types/cliff/ @brynbellomy /types/clipboard/ @impworks /types/clipboard-js/ @markwongsk /types/clipboardy/ @BendingBender +/types/clmtrackr/ @hellochar /types/clndr/ @jasperjn /types/clockpicker/ @jfcere +/types/cloneable-readable/ @qlonik +/types/cloner/ @matrumz /types/closure-compiler/ @mprobst /types/cloud-env/ @Morfent /types/cloudflare-apps/ @MartynasZilinskas @@ -496,14 +529,17 @@ /types/combined-stream/ @felixge @tlaziuk /types/combokeys/ @iclanton /types/cometd/ @derekcicerone -/types/command-line-args/ @CzBuCHi +/types/command-line-args/v4/ @CzBuCHi @75lb +/types/command-line-args/ @75lb /types/command-line-commands/ @CzBuCHi -/types/command-line-usage/ @Dvorsky +/types/command-line-usage/ @matrumz @Dvorsky /types/commangular/ @hiraash /types/comment-json/ @Jason3S +/types/common-errors/ @icopp /types/common-tags/ @zuzusik @tzupengwang /types/commonmark/ @nicojs @leonard-thieu /types/compare-version/ @jpevarnek +/types/compare-versions/ @LogvinovLeon /types/complex/ @AyaMorisawa /types/component-emitter/ @psnider /types/compose-function/ @denis-sokolov @@ -520,7 +556,7 @@ /types/configstore/ @ArcticLight /types/configurable/ @jewbre /types/confit/ @ethanresnick -/types/connect/ @SomaticIT +/types/connect/ @SomaticIT @EvanHahn /types/connect-busboy/ @pinguet62 /types/connect-ensure-login/ @0x6368656174 /types/connect-flash/ @AndreasGassmann @@ -543,7 +579,7 @@ /types/convert-hrtime/ @BendingBender /types/convert-layout/ @xeningem /types/convert-source-map/ @AndrewGaspar @mgroenhoff @TeamworkGuy2 -/types/convict/ @Nemo157 @vesse @elyscape +/types/convict/ @Nemo157 @vesse @elyscape @vanthiyathevan /types/cookie/ @pine613 /types/cookie-parser/ @santialbo @BendingBender /types/cookie-session/ @borislavjivkov @@ -576,7 +612,10 @@ /types/cordova_app_version_plugin/ @larrybahr /types/cordovarduino/ @hendrikmaus /types/core-js/ @rbuckton @mfdeveloper -/types/cosmiconfig/ @ozum +/types/correlation-id/ @natemara +/types/cors/ @pluma +/types/cosmiconfig/v4/ @ozum +/types/cosmiconfig/ @ozum @szeck87 @saadq /types/cote/ @makepost /types/couchbase/ @maouida /types/countdown/ @gjuchault @@ -593,13 +632,14 @@ /types/crc/ @YuJianrong /types/create-error/ @tkrotoff /types/create-react-class/ @jgoz +/types/create-subscription/ @Asana @vsiao /types/createjs/ @evilangelist @gyohk /types/createjs-lib/ @evilangelist @gyohk /types/credential/ @phuvo /types/credit-card-type/ @LKay /types/cron/ @horiuchi @winup /types/cropperjs/ @stepancar -/types/croppie/ @connor4312 @dklmuc @sarunint +/types/croppie/ @connor4312 @dklmuc @sarunint @knuthelgesen /types/cross-spawn/ @Alorel /types/crossfilter/ @schmuli @iebaker @nordfjord /types/crossroads/ @diullei @@ -628,29 +668,29 @@ /types/cwise-compiler/ @taoqf /types/cwise-parser/ @taoqf /types/cybozulabs-md5/ @pine613 -/types/cytoscape/ @phreed @wy193777 @ypconstante @janniclas +/types/cytoscape/ @phreed @wy193777 @ypconstante @janniclas @cerberuser /types/d3/v3/ @gustavderdrache @borisyankov @MatthiasJobst /types/d3/v4/ @tomwanzek @gustavderdrache @borisyankov /types/d3/ @tomwanzek @gustavderdrache @borisyankov /types/d3-array/ @gustavderdrache @borisyankov @tomwanzek -/types/d3-axis/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-axis/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-box/ @lk-chen /types/d3-brush/ @tomwanzek @gustavderdrache @borisyankov /types/d3-chord/ @tomwanzek @gustavderdrache @borisyankov /types/d3-collection/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-color/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-color/ @tomwanzek @gustavderdrache @borisyankov @denisname @ledragon /types/d3-contour/ @tomwanzek @Ledragon -/types/d3-dispatch/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-dispatch/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-drag/ @tomwanzek @gustavderdrache @borisyankov /types/d3-dsv/ @tomwanzek @gustavderdrache @borisyankov /types/d3-ease/ @tomwanzek @gustavderdrache @borisyankov /types/d3-fetch/ @ledragon /types/d3-force/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-format/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-geo/ @Ledragon @tomwanzek @gustavderdrache @borisyankov +/types/d3-format/ @tomwanzek @gustavderdrache @borisyankov @denisname +/types/d3-geo/ @ledragon @tomwanzek @gustavderdrache @borisyankov /types/d3-hexbin/ @uncovertruth @tomwanzek /types/d3-hierarchy/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-hsv/ @arrayjam +/types/d3-hsv/ @arrayjam @denisname /types/d3-interpolate/ @tomwanzek @gustavderdrache @borisyankov /types/d3-path/ @tomwanzek @gustavderdrache @borisyankov /types/d3-polygon/ @tomwanzek @gustavderdrache @borisyankov @@ -702,6 +742,7 @@ /types/db-migrate-pg/ @nickiannone /types/db.js/ @cgwrench /types/dc/ @hansrwindhoff @mtraynham @MatthiasJobst +/types/dd-trace/ @ColinBradley /types/deasync/ @Sicilica /types/debessmann/ @vkorehov /types/debounce/ @denis-sokolov @@ -724,16 +765,20 @@ /types/defer-promise/ @niklasf /types/define-lazy-prop/ @BendingBender /types/defined/ @BendingBender +/types/deglob/ @saadq /types/deku/ @pocka /types/del/v2/ @AyaMorisawa /types/del/ @AyaMorisawa @BendingBender @bitjson /types/delaunator/ @DenisCarriere /types/delay/ @BendingBender +/types/deline/ @iarroyo5 /types/denodeify/ @joaomoreno /types/deoxxa-content-type/ @pine613 /types/depcheck/ @ark120202 /types/depd/ @danny8002 @BendingBender +/types/dependency-tree/ @joscha /types/deployjava/ @cyrilschumacher +/types/derhuerst__cli-on-key/ @jacobbubu /types/destroy/ @BendingBender /types/destroy-on-hwm/ @BendingBender /types/detect-browser/ @rogierschouten @@ -746,6 +791,7 @@ /types/detect-pointer/ @thomastilkema /types/detect-port/ @lith-light-g /types/detect-touch-events/ @thomastilkema +/types/detox/ @TareqElMasri /types/df-visible/ @Litee /types/dhtmlxgantt/ @mkozhukh @chriscamicas /types/dhtmlxscheduler/ @mkozhukh @@ -755,6 +801,7 @@ /types/diff2html/ @rtfpessoa /types/dir-resolve/ @andy-ms /types/discontinuous-range/ @OiCMudkips +/types/discourse-sso/ @championswimmer /types/dispatchr/ @Ragg- /types/disposable-email-domains/ @geoffreak /types/dnssd/ @angelmerino @@ -762,11 +809,13 @@ /types/dockerode/ @seikho @nlaplante @isac322 @lazarusx @meisenzahl @thegecko /types/docopt/ @giggio /types/doctrine/ @rictic +/types/document-promises/ @NotWoods /types/documentdb/ @NoelAbrahams @brettferdosi @ctstone @yifanwu /types/documentdb-server/ @lith-light-g /types/documentdb-session/ @DanielRosenwasser /types/dojo/ @vansimke /types/dom-inputevent/ @diagramatics +/types/dom-to-image/ @JipSterk /types/dom4/ @adidahiya @giladgray /types/domo/ @Steve-Fenton /types/dompurify/ @bazuzi @@ -824,7 +873,7 @@ /types/easy-xapi/ @DeadAlready /types/easy-xapi-utils/ @DeadAlready /types/ebongarde-root/ @Ebongarde -/types/echarts/ @xieisabug @AntiMoron +/types/echarts/ @xieisabug @AntiMoron @liveangela /types/ecurve/ @mhegazy /types/ed25519/ @erikma /types/ed2curve/ @ffflorian @@ -839,7 +888,7 @@ /types/elasticsearch/ @CasperSkydt @bfsmith @ddunkin @pushplay @mlamp @ahmadferdous @SimonSchick @brabster @deerawan /types/electron-config/ @mrfunkycold @unindented /types/electron-debug/ @unindented -/types/electron-devtools-installer/ @gamesmaxed +/types/electron-devtools-installer/ @gamesmaxed @mfatihmar /types/electron-is-dev/ @trodi /types/electron-json-storage/ @stpettersens @nrlquaker @jbw91 /types/electron-notifications/ @djpereira @@ -886,6 +935,7 @@ /types/enzyme-adapter-react-15/ @tkrotoff /types/enzyme-adapter-react-15.4/ @nali /types/enzyme-adapter-react-16/ @tkrotoff +/types/enzyme-redux/ @knegusen /types/enzyme-to-json/ @joscha /types/eonasdan-bootstrap-datetimepicker/ @ToastHawaii /types/epiceditor/ @borisyankov @@ -902,7 +952,7 @@ /types/escape-regexp/ @jewbre /types/escape-string-regexp/ @kruncher @faergeek /types/escodegen/ @simondel -/types/eslint/ @pmdartus @j-f1 +/types/eslint/ @pmdartus @j-f1 @saadq /types/eslint-plugin-prettier/ @ikatyang /types/eslint-scope/ @mysticatea /types/eslint-visitor-keys/ @mysticatea @@ -915,12 +965,15 @@ /types/estraverse/ @sanex3339 /types/estree/ @RReverser /types/etag/ @BendingBender +/types/ethereumjs-abi/ @LogvinovLeon +/types/ethereumjs-tx/ @LogvinovLeon /types/ethereumjs-util/ @cortopy /types/ethjs-signer/ @doppio /types/eureka-js-client/ @Schnillz -/types/evaporate/ @kookster @chrisrhoden +/types/evaporate/ @kookster @chrisrhoden @ailrun /types/event-emitter/ @LKay /types/event-emitter-es6/ @ahstro +/types/event-hooks-webpack-plugin/ @pine /types/event-kit/ @GlenCFL /types/event-loop-lag/ @rogierschouten /types/event-stream/ @flcdrg @@ -941,6 +994,7 @@ /types/expectations/ @vvakame /types/expo/v23/ @KonstantinKai /types/expo/v24/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger +/types/expo/v25/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov /types/expo/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov /types/expo__vector-icons/ @incleaf /types/express/ @borisyankov @@ -951,6 +1005,7 @@ /types/express-bunyan-logger/ @shreyjain1994 /types/express-busboy/ @pinguet62 /types/express-cluster/ @nenadalm +/types/express-correlation-id/ @natemara /types/express-debug/ @federicobond /types/express-domain-middleware/ @hookclaw /types/express-ejs-layouts/ @erikma @@ -962,6 +1017,7 @@ /types/express-formidable/ @tdolsen @evanshortiss /types/express-graphql/ @isman-usoh @nitintutlani @hubel @zya @mlamp @firede /types/express-handlebars/ @stpettersens @yhaskell +/types/express-jsonschema/ @atd-schubert /types/express-jwt/ @wokim @kacepe @Sl1MBoy @milan-mimra /types/express-less/ @xieyubo /types/express-minify/ @borislavjivkov @@ -971,26 +1027,32 @@ /types/express-mysql-session/ @Akim95 /types/express-oauth-server/ @atd-schubert /types/express-openapi/ @mugeso +/types/express-paginate/ @AmirTugi /types/express-partials/ @jt000 /types/express-promise-router/ @wanganjun /types/express-rate-limit/ @cyrilschumacher @makepost /types/express-route-fs/ @kripod +/types/express-routemap/ @icopp /types/express-sanitized/ @cjbarth /types/express-serve-static-core/ @borisyankov @19majkel94 @kacepe @micksatana @samijaber /types/express-session/ @horiuchi @jacobbogers @builtinnya @ry7n +/types/express-socket.io-session/ @AylaJK /types/express-to-koa/ @xiaohanzhang /types/express-unless/ @wokim /types/express-winston/ @bricka +/types/express-ws/ @ajliv +/types/express-xml-bodyparser/ @noticeMaker /types/extend/ @reppners /types/extjs/ @brian428 +/types/extract-files/ @Slessi /types/extract-stack/ @BendingBender /types/extract-text-webpack-plugin/ @flying-sheep @katyo /types/extract-zip/ @mizunashi-mana /types/eyes/ @brynbellomy /types/ez-plus/ @AndersonFriaca /types/f1/ @neolwc -/types/fabric/ @oklemencic @joewashear007 @mrand01 @NotWoods @bmartinson -/types/facebook-instant-games/ @menushka +/types/fabric/ @oklemencic @joewashear007 @mrand01 @NotWoods @bmartinson @RogerioTeixeira +/types/facebook-instant-games/ @menushka @oyvindjam /types/facebook-js-sdk/ @amritk /types/facebook-pixel/ @noctishsu /types/faker/v3/ @Kuniwak @@ -1010,9 +1072,11 @@ /types/fast-stats/ @rogierschouten /types/fastclick/ @shinnn /types/favico.js/ @drowse314-dev-ymat +/types/favicons/ @mohsen1 /types/fb/ @JoshStrobl /types/fb-watchman/ @whtsky /types/fbemitter/ @kmxz +/types/feather-icons/ @jineshshah36 /types/featherlight/ @xStrom /types/feathersjs__authentication/ @AbraaoAlves @j2L4e /types/feathersjs__authentication-client/ @AbraaoAlves @j2L4e @@ -1038,6 +1102,7 @@ /types/ffi/ @loyd /types/ffmpeg-static/ @iamstevetran /types/ffprobe-static/ @iamstevetran +/types/fhir-js-client/ @rmchndrng /types/fibers/ @soywiz /types/figures/ @BendingBender /types/file-exists/ @BendingBender @@ -1047,11 +1112,13 @@ /types/filenamify/ @rokt33r /types/filesize/ @GiedriusGrabauskas @renchap /types/fill-pdf/ @westy92 +/types/filter-invalid-dom-props/ @icopp /types/finalhandler/ @chrootsu /types/finch/ @DavidSichau /types/find/ @andypyrope /types/find-root/ @Alorel /types/find-up/ @BendingBender +/types/find-versions/ @LogvinovLeon /types/findup-sync/ @Bartvds @ngbrown /types/fingerprintjs/ @zaneli /types/fingerprintjs2/ @curtstate @@ -1070,18 +1137,23 @@ /types/flight/ @jonathanhedren /types/flightplan/ @borislavjivkov /types/flipsnap/ @kubosho @gsino @mayuki +/types/float-regex/ @wanganjun /types/flot/ @burlandm @Anticom @admiralsmaster /types/flowjs/ @ryan10132 /types/fluent-ffmpeg/ @tcaesvk @DingWeizhe /types/flux/ @stkb @GiedriusGrabauskas +/types/fluxible/ @xbim +/types/fluxible-router/ @xbim /types/fluxxor/ @mrk21 /types/fm-websync/ @markusmauch /types/fnv-lite/ @marcind +/types/focus-within/ @eramdam /types/fontfaceobserver/ @RandScullard /types/fontoxml/ @rolandzwaga /types/forever-agent/ @yavanosta /types/forever-monitor/ @shuntksh @wrboyce /types/forge-di/ @adamcarr +/types/fork-ts-checker-webpack-plugin/ @JounQin /types/form-data/ @soywiz @leonyu @BendingBender /types/form-serializer/ @flqw /types/form-urlencoded/ @alepee @@ -1098,6 +1170,7 @@ /types/freedom/ @jpevarnek /types/freeport/ @atd-schubert /types/fresh/ @BendingBender +/types/freshy/ @qlonik /types/friendly-errors-webpack-plugin/ @bahlo /types/frisby/v0/ @johnny4753 /types/frisby/ @cwoodland @johnny4753 @@ -1108,7 +1181,7 @@ /types/fs-cson/ @dex4er /types/fs-ext/ @OguzhanE /types/fs-extra/v4/ @alan-agius4 @midknight41 @shiftkey @mees- -/types/fs-extra/ @alan-agius4 @midknight41 @shiftkey @mees- +/types/fs-extra/ @alan-agius4 @midknight41 @shiftkey @mees- @jrockwood /types/fs-extra-promise/ @midknight41 @jasonswearingen @HiromiShikata /types/fs-extra-promise-es6/ @midknight41 @jasonswearingen @geoffreak @HiromiShikata /types/fs-finder/ @misak113 @@ -1278,7 +1351,7 @@ /types/generic-pool/ @jerray @wrboyce /types/gently/ @bonnici /types/geodesy/ @DenisCarriere @HandyG52 @excelulous -/types/geojson/ @cobster @atd-schubert @JeffJacobson +/types/geojson/ @cobster @atd-schubert @JeffJacobson @icholy /types/geojson2osm/ @DenisCarriere /types/geokdbush/ @DenisCarriere /types/geometry-dom/ @nakakura @@ -1300,6 +1373,8 @@ /types/github-username-regex/ @BehindTheMath /types/gitlab/ @yanqing6628780 @Arylo /types/gl-matrix/ @mattijskneppers @tatchx @nbabanov @auzmartist @surtr-isaz +/types/gl-shader/ @MathiasPaumgarten +/types/gl-texture2d/ @MathiasPaumgarten /types/gldatepicker/ @qcz /types/glidejs/ @milanjaros /types/glob/ @vvakame @voy @@ -1323,7 +1398,7 @@ /types/google-cloud__storage/ @blove @nbperry /types/google-earth/ @icholy /types/google-images/ @dolanmiu -/types/google-libphonenumber/ @leonyu +/types/google-libphonenumber/ @leonyu @winfinit /types/google-map-react/ @honzabrecka /types/google-maps/ @DeividasBakanas @GiedriusGrabauskas /types/google-protobuf/ @marcuslongmuir @@ -1335,13 +1410,16 @@ /types/google.visualization/ @danludwig @gmoore-sjcorg @danmana @mlcheng @IvanBisultanov @glebm /types/googlemaps/ @cgwrench @nertzy @xaolas @mrmcnerd @martincostello @svenkreiss /types/googlemaps.infobubble/ @Dashue -/types/got/ @BendingBender @LinusU +/types/googlepay/ @Fluccioni +/types/got/ @BendingBender @LinusU @ikokostya /types/graceful-fs/v2/ @Bartvds /types/graceful-fs/ @Bartvds @BendingBender /types/graham_scan/ @hberntsen /types/graphite-udp/ @EricByers -/types/graphql/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx @rportugal @tgriesser @dyst5422 @adnsio @divyenduz +/types/graphql/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx @rportugal @tgriesser @dyst5422 @adnsio @divyenduz @bradzacher /types/graphql-date/ @enaeseth +/types/graphql-deduplicator/ @lfades +/types/graphql-depth-limit/ @eritikass /types/graphql-iso-date/ @jwaldrip /types/graphql-list-fields/ @filipows /types/graphql-relay/ @arvitaly @nitintutlani @Grelinfo @@ -1355,11 +1433,12 @@ /types/grecaptcha/v0/ @brentj73 /types/grecaptcha/ @DethAriel /types/gregorian-calendar/ @cwalv -/types/grid-styled/ @antonvasin +/types/grid-styled/ @antonvasin @vittorio @lhache /types/gridfs-stream/ @liorm /types/gridstack/ @PascalSenn @ZoolWay @Sl1MBoy /types/grunt/ @jeffmay @basarat /types/gsap/ @codebelt @ProbablePrime @philipbulley +/types/gtin/ @RafaelKr /types/guid/ @maroy1986 /types/gulp/ @GiedriusGrabauskas /types/gulp-angular-templatecache/ @amanmahajan7 @@ -1368,6 +1447,7 @@ /types/gulp-bump/ @silkentrance /types/gulp-cache/ @aravindarun /types/gulp-cached/ @tomc974 +/types/gulp-change/ @Aankhen /types/gulp-changed/ @tomc974 /types/gulp-cheerio/ @tkQubo /types/gulp-clean-dest/ @andypyrope @@ -1390,6 +1470,8 @@ /types/gulp-html-replace/ @peterjuras /types/gulp-htmlmin/ @tkrotoff /types/gulp-if/ @joeskeen +/types/gulp-image/ @Aankhen +/types/gulp-image-resize/ @Aankhen /types/gulp-inject/ @k-kagurazaka /types/gulp-insert/ @shantmarouti /types/gulp-install/ @peterjuras @@ -1411,6 +1493,7 @@ /types/gulp-protractor/ @tkrotoff /types/gulp-pug/ @remisery /types/gulp-remember/ @tomc974 +/types/gulp-responsive-images/ @aankhen /types/gulp-rev/ @tkrotoff /types/gulp-rev-replace/ @tkrotoff /types/gulp-ruby-sass/ @agnislav @@ -1419,6 +1502,7 @@ /types/gulp-sort/ @joeskeen /types/gulp-strip-debug/ @peterjuras /types/gulp-svg-sprite/ @tkqubo +/types/gulp-svgmin/ @Aankhen /types/gulp-task-listing/ @joeskeen /types/gulp-tsd/ @k-kagurazaka /types/gulp-uglify/ @ChristopherHaws @leonard-thieu @@ -1433,12 +1517,12 @@ /types/halfred/ @dherges /types/halogen/ @steller /types/hammerjs/ @milkisevil @codler -/types/handlebars/ @borisyankov +/types/handlebars/ @borisyankov @evil-shrike /types/hapi/v8/ @jasonswearingen /types/hapi/v12/ @jasonswearingen /types/hapi/v15/ @jasonswearingen /types/hapi/v16/ @jasonswearingen @AJamesPhillips -/types/hapi/ @BorntraegerMarc @rafaelsouzaf @jhsimms +/types/hapi/ @BorntraegerMarc @rafaelsouzaf @jhsimms @SimonSchick /types/hapi-auth-basic/ @AJamesPhillips @saboya /types/hapi-auth-jwt2/v7/ @warrenseymour /types/hapi-auth-jwt2/ @warrenseymour @SimonSchick @@ -1455,7 +1539,8 @@ /types/hashmap/ @outring /types/haversine/ @screendriver /types/hbs/ @davidm77 -/types/he/ @sedwards2009 +/types/hdkey/ @LogvinovLeon +/types/he/ @sedwards2009 @lokidokicoki /types/headroom/ @hakubo /types/heap/ @ryan10132 /types/heapdump/ @weekens @@ -1465,7 +1550,7 @@ /types/hellosign-embedded/ @xt0rted /types/helmet/ @cyrilschumacher @EvanHahn @bluehatbrit /types/heredatalens/ @denyo -/types/heremaps/ @Josh-ES @denyo +/types/heremaps/ @Josh-ES @denyo @fx88 /types/heroku-logger/ @kylevogt /types/hex-rgba/ @r3nya /types/hexo-bunyan/ @segayuu @@ -1480,6 +1565,7 @@ /types/history/v3/ @sergey-buturlakin @ngbrown @LKay /types/history/ @sergey-buturlakin @ngbrown @rokoroku /types/history.js/ @borisyankov @gjunge +/types/historykana/ @h-shiratsuki /types/hjson/ @crunchie84 /types/hls.js/ @jgainfort /types/hoek/ @prashaantt @@ -1492,11 +1578,12 @@ /types/html-minifier/v1/ @tkrotoff /types/html-minifier/ @tkrotoff @rikuayanokozy /types/html-pdf/ @westy92 +/types/html-tag-names/ @sandersn /types/html-to-text/ @erykwarren /types/html-void-elements/ @rhysd /types/html-webpack-plugin/ @deevus @bumbleblym @tlaziuk /types/html-webpack-template/ @bumbleblym -/types/html2canvas/ @rwhepburn @tan9 +/types/html2canvas/ @rwhepburn @tan9 @sschocke /types/htmlbars-inline-precompile/ @chriskrycho /types/htmlparser2/ @staticfunction @LinusU /types/htmltojsx/ @basarat @@ -1505,14 +1592,14 @@ /types/http-codes/ @mhegazy /types/http-context/ @mtraynham /types/http-errors/ @tkrotoff @BendingBender -/types/http-proxy/ @SomaticIT @Raigen +/types/http-proxy/ @SomaticIT @Raigen @DanielMSchmidt /types/http-proxy-agent/ @mrmlnc /types/http-proxy-middleware/ @zebMcCorkle @BendingBender /types/http-server/ @plantain-00 /types/http-status/ @misak113 /types/http-string-parser/ @pine613 /types/httperr/ @yortus -/types/hubot/ @dirk +/types/hubot/ @dirk @KeesCBakker /types/hubspot-pace/ @borislavjivkov /types/humane/ @jmvrbanac /types/humanize-plus/ @DenisCarriere @@ -1540,7 +1627,11 @@ /types/icepick/ @ngbrown @tobico /types/icheck/ @qcz /types/iconv/ @delphinus35 -/types/ids/ @3fd +/types/idyll/ @iocat +/types/idyll-ast/ @iocat +/types/idyll-compiler/ @iocat +/types/idyll-document/ @iocat +/types/iferr/ @segayuu /types/iframe-resizer/ @arminbaljic /types/ignite-ui/ @IgniteUI /types/ignore-styles/ @tai2 @@ -1555,6 +1646,7 @@ /types/imap-simple/ @pushplay /types/imgur-rest-api/ @lukewestby /types/impress/ @borisyankov +/types/in-app-purchase/ @l-jonas /types/in-range/ @DanielRosenwasser /types/incremental-dom/ @basarat @lanthaler @vvakame /types/indent-string/ @mhegazy @@ -1572,7 +1664,8 @@ /types/insight/ @vvakame /types/integer/ @Morfent /types/interact.js/ @dduugg @adidahiya @thasner -/types/intercom-web/ @fongandrew @salbahra +/types/intercom-client/ @jineshshah36 +/types/intercom-web/ @fongandrew @salbahra @onatm /types/intercomjs/ @spencerwi /types/internal-ip/ @BendingBender /types/intl/ @RagibHasin @@ -1597,6 +1690,7 @@ /types/is-archive/ @mhegazy /types/is-array/ @pine /types/is-binary-path/ @DanielRosenwasser +/types/is-ci/ @atd-schubert /types/is-color/ @VitorLuizC /types/is-compressed/ @mhegazy /types/is-empty/ @termosa @@ -1604,6 +1698,7 @@ /types/is-glob/ @mrmlnc /types/is-hotkey/ @petester42 /types/is-ip/ @coderslagoon +/types/is-mobile/ @LogvinovLeon /types/is-my-json-valid/ @kruncher /types/is-negated-glob/ @ajafff /types/is-number/ @harryshipton @@ -1622,7 +1717,7 @@ /types/is-url-superb/ @kryops /types/is-windows/ @mizunashi-mana /types/isbn-utils/ @elhaard -/types/iscroll/ @csrakowski +/types/iscroll/ @csrakowski @devlato /types/ismobilejs/ @Ty3uK /types/iso-3166-2/ @sicilica /types/iso8601-localizer/ @avielfedida @@ -1667,8 +1762,10 @@ /types/jdenticon/ @mtr /types/jest/v16/ @NoHomey @jwbay /types/jest/ @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd @JamieMason @douglasduteil @AhnpGit @joshuakgoldberg @bradleyayers +/types/jest-axe/ @JoshuaKGoldberg /types/jest-diff/ @myabc /types/jest-docblock/ @ikatyang +/types/jest-each/ @theutz /types/jest-environment-puppeteer/ @joshuakgoldberg /types/jest-get-type/ @myabc /types/jest-image-snapshot/ @dawnmist @@ -1684,11 +1781,12 @@ /types/jmespath/ @pushplay /types/johnny-five/ @nakakura @ujvzolee @workshop2 /types/joi/v6/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW -/types/joi/v10/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku -/types/joi/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @dankraus @wanganjun @rafaelkallis +/types/joi/v10/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @aconanlai +/types/joi/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @dankraus @wanganjun @rafaelkallis @aconanlai /types/joigoose/ @boothwhack /types/josa/ @vichyssoise /types/jpeg-js/ @DanielRosenwasser +/types/jpegtran-bin/ @hikoma /types/jpm/ @github-account-because-they-want-it /types/jqgrid/ @lokeshpeta /types/jqrangeslider/ @qcz @@ -1706,6 +1804,8 @@ /types/jquery-drawer/ @pine /types/jquery-easy-loading/ @delphinus35 /types/jquery-editable-select/ @baywet +/types/jquery-focus-exit/ @AndersonFriaca +/types/jquery-focusable/ @AndersonFriaca /types/jquery-fullscreen/ @bgrieder /types/jquery-galleria/ @rimig /types/jquery-handsontable/ @intelorca @@ -1713,13 +1813,16 @@ /types/jquery-jsonrpcclient/ @Ty3uK /types/jquery-knob/ @iain8 /types/jquery-lazyload/ @AndersonFriaca +/types/jquery-loading-overlay/ @AndersonFriaca /types/jquery-mask-plugin/ @avidenic @AndersonFriaca /types/jquery-maskmoney/ @AndersonFriaca /types/jquery-match-height/ @kbytesys /types/jquery-mockjax/ @laszlojakab @vladeck /types/jquery-mousewheel/ @xt0rted +/types/jquery-next-id/ @AndersonFriaca /types/jquery-notifier/ @allipierre /types/jquery-param/ @patsissons +/types/jquery-slugify/ @AndersonFriaca /types/jquery-sortable/ @Seltzer /types/jquery-steps/ @jblank @nickwph /types/jquery-sticky/ @maixiu @@ -1810,6 +1913,7 @@ /types/js-git/ @Bartvds /types/js-md5/ @mwmccarthy /types/js-money/ @kanatkubash +/types/js-nacl/ @ethanfrey /types/js-quantities/ @wrummler /types/js-schema/ @marcinporebski @roblabat /types/js-search/ @guoyunhe @@ -1828,7 +1932,7 @@ /types/jsend/ @CaselIT /types/jsesc/ @Bartvds /types/jsfl/ @soywiz -/types/jsforce/ @dolanmiu @netes +/types/jsforce/ @dolanmiu @netes @amphro @tnoonan-salesforce /types/jshamcrest/ @dharkness /types/jsmockito/ @shiver-me-timbers /types/jsnox/ @stkb @DovydasNavickas @@ -1845,11 +1949,13 @@ /types/json-stringify-safe/ @BendingBender /types/json2csv/ @juanjoDiaz /types/json2md/ @MartynasZilinskas +/types/json3/ @NN--- /types/jsonata/ @nick121212 /types/jsoneditor/ @alejo90 /types/jsoneditor-for-react/ @joshuakgoldberg /types/jsoneditoronline/ @vbortone /types/jsonfile/ @dbowring +/types/jsonic/ @jacobbubu /types/jsonminify/ @no23reason /types/jsonnet/ @hookclaw /types/jsonp/ @surenkov @@ -1857,8 +1963,8 @@ /types/jsonrpc-serializer/ @Akim95 @many20 /types/jsonstream/ @Bartvds /types/jsontoxml/ @benstevens48 -/types/jsonwebtoken/ @SomaticIT @danielheim @brikou -/types/jsonwebtoken-promisified @aneilbaboo +/types/jsonwebtoken/ @SomaticIT @danielheim @brikou @vpk +/types/jsonwebtoken-promisified/ @SomaticIT @danielheim @brikou @aneilbaboo /types/jspdf/ @amberjs /types/jsqrcode/ @lordazzi /types/jsrender/ @zakki @@ -1883,8 +1989,9 @@ /types/jui/ @easylogic /types/jui-core/ @easylogic /types/jui-grid/ @easylogic +/types/just-extend/ @pe8ter /types/jweixin/ @taoqf @gomydodo -/types/jwplayer/ @martinduparc @kutomer @philippguertler @danielmcgraw +/types/jwplayer/ @martinduparc @kutomer @philippguertler @danielmcgraw @bpdsw /types/jws/ @JustinBeckwith /types/jwt-client/ @timoteoponce /types/jwt-decode/v1/ @QuatroDevOfficial @@ -1965,6 +2072,7 @@ /types/koa-pug/ @Xstoudi /types/koa-range/ @strax /types/koa-redis/ @nsimmons +/types/koa-response-time/ @thorsedeke /types/koa-route/ @migstopheles /types/koa-router/ @hellopao @schfkt /types/koa-send/ @pe8ter @tlaziuk @@ -1975,6 +2083,7 @@ /types/koa-views/ @brooklyndev /types/koa-webpack/ @malj /types/koa-websocket/ @me +/types/koa-xml-body/ @uwinkelvos /types/koa2-cors/ @xialeistudio /types/koa__cors/ @Xstoudi @izayoiko @stevehipwell /types/kolite/ @borisyankov @@ -1982,7 +2091,7 @@ /types/kraken-js/ @darkwebdev /types/kramed/ @tonicblue /types/kss/ @giladgray -/types/kue/ @drudge @amiram @pc-jedi +/types/kue/ @drudge @amiram @pc-jedi @deerawan /types/kurento-utils/ @nenadalm @riggs /types/kuromoji/ @mzsm @kgtkr /types/lab/ @prashaantt @@ -1992,25 +2101,27 @@ /types/latinize/ @GiedriusGrabauskas /types/latlon-geohash/ @rimig /types/launchpad/ @rictic +/types/lazy-value/ @ikatyang /types/lazy.js/ @Bartvds /types/lazypipe/ @tomc974 /types/ldapjs/ @cvillemure @peterkooijmans /types/leadfoot/ @theintern /types/leaflet/v0/ @rgripper -/types/leaflet/ @alejo90 @atd-schubert +/types/leaflet/ @alejo90 @atd-schubert @mcauer /types/leaflet-areaselect/ @awallat /types/leaflet-curve/ @onikiienko -/types/leaflet-draw/ @matt-guest @reblace @YunS-Stacy +/types/leaflet-draw/ @matt-guest @reblace @YunS-Stacy @beschoenen /types/leaflet-editable/ @dalie /types/leaflet-fullscreen/ @DenisCarriere /types/leaflet-geocoder-mapzen/ @leezu -/types/leaflet-gpx/ @soucekv +/types/leaflet-gpx/ @soucekv @molnarm /types/leaflet-imageoverlay-rotated/ @tkleinke /types/leaflet-label/ @Nemo157 /types/leaflet-mouse-position/ @Hanyon /types/leaflet-polylinedecorator/ @soucekv /types/leaflet-providers/ @BendingBender /types/leaflet-rotatedmarker/ @robert-prib-polestar +/types/leaflet-routing-machine/ @chanakadrathnayaka /types/leaflet.awesome-markers/v0/ @Odrin @sebek64 /types/leaflet.awesome-markers/ @sebek64 /types/leaflet.fullscreen/ @wcomartin @@ -2024,6 +2135,7 @@ /types/leaflet.polylinemeasure/ @RiON69 /types/leapmotionts/ @logotype /types/legal-eagle/ @j-f1 +/types/lerna-get-packages/ @LogvinovLeon /types/less/ @thasner @pranaygp /types/less-middleware/ @federicobond /types/less2sass/ @gatimus @@ -2047,6 +2159,7 @@ /types/load-json-file/ @SamVerschueren /types/loader-runner/ @e-cloud /types/loader-utils/ @Perlmint @TotooriaHyperion +/types/loadjs/ @screendriver /types/loadware/ @ALyman /types/lobibox/ @itboy87 /types/local-dynamo/ @Sicilica @@ -2356,7 +2469,7 @@ /types/lokijs/ @TeamworkGuy2 @thomasconner /types/lolex/ @Nemo157 @joshuakgoldberg @rogierschouten /types/long/ @peterkooijmans -/types/loopback/ @kattsushi @enko @sequoia @drmikecrowe +/types/loopback/ @kattsushi @enko @sequoia @drmikecrowe @karimsa /types/loopback-boot/ @kattsushi /types/lorem-ipsum/ @durad /types/lory.js/ @kubosho @milkisevil @@ -2390,6 +2503,8 @@ /types/map-obj/ @BendingBender /types/mapbox/ @anahkiasen /types/mapbox-gl/ @dobrud @patrickr +/types/mapbox-gl-leaflet/ @agorshkov23 +/types/mapbox__geojson-area/ @n0nick /types/mapbox__shelf-pack/ @Perlmint /types/mapnik/ @ipv4sec /types/mapsjs/ @davismj @@ -2408,35 +2523,41 @@ /types/massive/v3/ @swissspidy @clarenceh /types/massive/ @swissspidy @clarenceh @AmazingTurtle /types/match-media-mock/ @asvetliakov -/types/material-components-web/ @BrentDouglas +/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 +/types/material-ui/ @ngbrown @theigor @alitaheri @herrmanno @DaIgeb @allienna @schlesingermatthias @InsidersByte @artyomsv @dan-j @minodisk @samwalshnz /types/material-ui-datatables/ @coding2012 -/types/material__animation/ @BrentDouglas -/types/material__auto-init/ @BrentDouglas -/types/material__base/ @BrentDouglas -/types/material__checkbox/ @BrentDouglas -/types/material__dialog/ @BrentDouglas -/types/material__drawer/ @BrentDouglas -/types/material__form-field/ @BrentDouglas -/types/material__grid-list/ @BrentDouglas -/types/material__icon-toggle/ @BrentDouglas -/types/material__linear-progress/ @BrentDouglas -/types/material__menu/ @BrentDouglas -/types/material__radio/ @BrentDouglas -/types/material__ripple/ @BrentDouglas -/types/material__select/ @BrentDouglas -/types/material__selection-control/ @BrentDouglas -/types/material__slider/ @BrentDouglas -/types/material__snackbar/ @BrentDouglas -/types/material__tabs/ @BrentDouglas -/types/material__textfield/ @BrentDouglas -/types/material__toolbar/ @BrentDouglas +/types/material__animation/ @BrentDouglas @ckosti +/types/material__auto-init/ @BrentDouglas @ckosti +/types/material__base/ @BrentDouglas @ckosti +/types/material__checkbox/ @BrentDouglas @ckosti +/types/material__chips/ @BrentDouglas @ckosti +/types/material__dialog/ @BrentDouglas @ckosti +/types/material__drawer/ @BrentDouglas @ckosti +/types/material__floating-label/ @BrentDouglas @ckosti +/types/material__form-field/ @BrentDouglas @ckosti +/types/material__grid-list/ @BrentDouglas @ckosti +/types/material__icon-toggle/ @BrentDouglas @ckosti +/types/material__line-ripple/ @BrentDouglas @ckosti +/types/material__linear-progress/ @BrentDouglas @ckosti +/types/material__menu/ @BrentDouglas @ckosti +/types/material__notched-outline/ @BrentDouglas @ckosti +/types/material__radio/ @BrentDouglas @ckosti +/types/material__ripple/ @BrentDouglas @ckosti +/types/material__select/ @BrentDouglas @ckosti +/types/material__selection-control/ @BrentDouglas @ckosti +/types/material__slider/ @BrentDouglas @ckosti +/types/material__snackbar/ @BrentDouglas @ckosti +/types/material__tab/ @BrentDouglas @ckosti +/types/material__tabs/ @BrentDouglas @ckosti +/types/material__textfield/ @BrentDouglas @ckosti +/types/material__toolbar/ @BrentDouglas @ckosti +/types/material__top-app-bar/ @BrentDouglas @ckosti /types/materialize-css/v0/ @eriklieben @leonyu @SinghSukhdeep @jfcere @scote @LiadIdan -/types/materialize-css/ @huww98 +/types/materialize-css/ @huww98 @MaximBalaganskiy @MonizDave @broccoliarchy /types/math3d/ @laszlojakab @jimsmart /types/mathjax/ @rolandzwaga -/types/mathjs/ @siavol +/types/mathjs/ @siavol @andnp /types/matter-js/ @piranha771 @hasparus /types/maxmind/ @geoffreak /types/mcustomscrollbar/ @flurg @@ -2444,10 +2565,12 @@ /types/mdns/ @reppners /types/mdurl/ @rokt33r /types/media-typer/ @BendingBender -/types/medium-editor/ @keika299 +/types/medium-editor/ @keika299 @pascaliske /types/mem/ @SamVerschueren /types/mem-fs/ @MyFoodBag +/types/mem-fs-editor/ @MyFoodBag /types/memcached/ @KentarouTakeda +/types/memoize-one/ @karol-majewski /types/memoizee/ @juanpicado /types/memory-cache/ @jedigo @thieman /types/memory-fs/ @e-cloud @@ -2461,7 +2584,7 @@ /types/meshblu/ @fnipo /types/mess/ @Nemo157 /types/messenger/ @derekcicerone -/types/meteor/ @barbatus @fullflavedave @orefalo @dagatsoin @birkskyum @ardatan @stefanholzapfel +/types/meteor/ @barbatus @fullflavedave @orefalo @dagatsoin @birkskyum @ardatan @stefanholzapfel @andrei-markeev /types/meteor-accounts-phone/ @DAB0mB /types/meteor-collection-hooks/ @twastvedt /types/meteor-jboulhous-dev/ @vangorra @@ -2469,6 +2592,7 @@ /types/meteor-prime8consulting-oauth2/ @vangorra /types/meteor-publish-composite/ @vangorra /types/meteor-roles/ @vangorra @mattmm3d +/types/meteor-univserse-i18n/ @mathewmeconry /types/method-override/ @santialbo /types/methods/ @cprecioso /types/metric-suffix/ @davidm77 @@ -2500,9 +2624,12 @@ /types/mitm/ @alejo90 /types/mixpanel/ @hjellek @Manduro /types/mixto/ @vvakame +/types/mjml/ @aahoughton /types/mkdirp/ @Bartvds @mrmlnc +/types/mkdirp-promise/ @pluma /types/mkpath/ @optical /types/mobx-apollo/ @pselden +/types/mobx-devtools-mst/ @pluma /types/mocha/ @kazimanzurrashid @otiai10 @jt000 @enlight @cspotcode /types/mocha-each/ @magnostherobot /types/mocha-phantomjs/ @ErikSchierboom @@ -2517,6 +2644,7 @@ /types/mockery/ @jt000 /types/modernizr/ @borisyankov @theodorejb @leonyu @lucax88x @nhardy /types/modesl/ @neeschit +/types/module-alias/ @KevinRamharak /types/moji/ @yasupeke /types/moment-business/ @wonbyte /types/moment-business-time/ @swist @@ -2529,7 +2657,7 @@ /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 +/types/mongodb/ @CaselIT @alanmarcell @kikar @bitjson @dante-101 @mcortesi @EnricoPicci @AJCStriker @julien-c @daprahamian /types/mongoose/v4/ @simonxca @horiuchi @sindrenm @lukasz-zak /types/mongoose/ @horiuchi @sindrenm @lukasz-zak @Alorel @jendrikw @ethanresnick @vologab /types/mongoose-auto-increment/ @AyaMorisawa @@ -2546,12 +2674,14 @@ /types/moo/ @deltaidea @MofX /types/moonjs/ @DanielRosenwasser /types/morgan/ @staticfunction @pscanf +/types/morphdom/ @arvitaly /types/morris.js/ @mareek @sindilevich /types/mousetrap/ @qcz /types/move-concurrently/ @mgroenhoff /types/moviedb/ @basarat @0x6368656174 /types/moxios/ @itoasuka /types/mozilla-readability/ @charlesvdv +/types/mozjpeg/ @hikoma /types/mpromise/ @sgkim126 /types/mri/ @shiftkey @j-f1 /types/ms/ @danny8002 @@ -2565,13 +2695,15 @@ /types/multer/ @jt000 @DavidBR-SW @mxl @hyunseob /types/multer-gridfs-storage/v1/ @devconcept /types/multer-gridfs-storage/ @devconcept -/types/multer-s3/ @tcaesvk @galtalmor +/types/multer-s3/ @tcaesvk @galtalmor @terski /types/multi-typeof/ @mhegazy /types/multimatch/ @stephenlautier /types/multiparty/ @kenfdev /types/multiplexjs/ @KamyarNazeri /types/multisort/ @CzBuCHi /types/multistream/ @mrmlnc @kenzierocks +/types/muri/ @jloveridge +/types/murmurhash/ @atd-schubert /types/murmurhash-js/ @cvle /types/murmurhash3js/ @dlee-nvisia /types/musicmetadata/ @Xstoudi @@ -2590,7 +2722,7 @@ /types/nats-hemera/ @vforv /types/natsort/ @mgroenhoff /types/natural/ @dmoonfire -/types/natural-sort/ @a-morales +/types/natural-sort/ @a-morales @fluggo /types/navermaps/ @ckboyjiy /types/navigation/ @grahammendick /types/navigation-react/ @grahammendick @@ -2610,6 +2742,7 @@ /types/nes/ @NoHomey @saboya /types/net-keepalive/ @hertzg /types/netmask/ @mhfrantz +/types/network-interfaces/ @anderswestberg /types/new-relic-browser/ @renehamburger @piotrkubisa /types/newline-remove/ @OpenByteDev /types/newrelic/ @mastermatt @@ -2626,6 +2759,7 @@ /types/ng-i18next/ @cyrilschumacher /types/ng-notify/ @nzamosenchuk /types/ng-stomp/ @lpotapczuk +/types/ng-tags-input/ @GiorgosPap /types/ngbootbox/ @stpettersens /types/ngeohash/ @erkie /types/ngkookies/ @martinmcwhorter @@ -2633,31 +2767,32 @@ /types/ngprogress/ @martinmcwhorter /types/ngprogress-lite/ @LukeForder /types/ngreact/ @velveret +/types/ngsijs/ @guillermofr /types/ngstorage/ @kubiq /types/ngtoaster/ @btesser /types/ngwysiwyg/ @patrick-mackay /types/nightmare/ @horiuchi @samyang-au @Bleser92 /types/nightwatch/ @rkavalap @schlesiger /types/nivo-slider/ @AndersonFriaca -/types/noble/ @swook @wind-rider @shantanubhadoria @lukel99 @bioball @keton @thegecko +/types/noble/ @swook @shantanubhadoria @lukel99 @bioball @keton @thegecko /types/nock/ @bonnici @horiuchi @afharo @mastermatt @damour /types/nodal/ @charrondev /types/node/v4/ @eps1lon -/types/node/v6/ @WilcoBakker @inlined @eps1lon @Alorel -/types/node/v7/ @parambirs @tellnes @WilcoBakker @eps1lon -/types/node/v8/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @OliverJAsh @eps1lon @Hannes-Magnusson-CK @jkomyno @hoo29 @n-e -/types/node/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @OliverJAsh @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 @n-e +/types/node/v6/ @WilcoBakker @inlined @eps1lon @Alorel @KSXGitHub +/types/node/v7/ @parambirs @tellnes @WilcoBakker @eps1lon @KSXGitHub +/types/node/v8/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @hoo29 @n-e @brunoscheufler @KSXGitHub @islishude +/types/node/v9/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 @n-e @brunoscheufler @mohsen1 @KSXGitHub @a-tarasyuk @islishude +/types/node/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 @n-e @brunoscheufler @mohsen1 @KSXGitHub @a-tarasyuk @islishude /types/node-7z/ @erkie /types/node-array-ext/ @Beng89 /types/node-cache/ @chrootsu @dthunell @useltmann /types/node-calendar/ @luzianz /types/node-cleanup/ @agadar -/types/node-common-errors/ @icopp /types/node-cron/ @maximelkin /types/node-dir/ @panuhorsmalahti /types/node-dogstatsd/ @chrisbobo /types/node-emoji/ @jonestristand @styu -/types/node-fetch/ @torstenwerner +/types/node-fetch/ @torstenwerner @nikcorg /types/node-fibers/ @caryhaynie /types/node-forge/ @westy92 @flynetworks @a-k-g @rafal2228 /types/node-gcm/ @horiuchi @@ -2676,7 +2811,7 @@ /types/node-powershell/ @rodrigoff /types/node-pushnotifications/ @menushka /types/node-ral/ @ssddi456 -/types/node-red/ @andersea +/types/node-red/ @andersea @tbowmo /types/node-rsa/ @alitaheri @xm /types/node-schedule/ @cyrilschumacher @flowpl /types/node-slack/ @tkQubo @@ -2684,7 +2819,7 @@ /types/node-sprite-generator/ @Perlmint /types/node-static/ @Morfent /types/node-statsd/ @alexturek @convoyinc -/types/node-telegram-bot-api/ @ammuench @agadar @Dabolus +/types/node-telegram-bot-api/ @ammuench @agadar @Dabolus @Kallu609 /types/node-uuid/ @jeffmay /types/node-validator/ @kengorab /types/node-vault/ @YuJianrong @@ -2712,7 +2847,7 @@ /types/normalize-url/ @odin3 @BendingBender /types/notie/ @mateusdemboski /types/notify/ @hellochar -/types/notifyjs/ @soundTricker +/types/notifyjs/ @soundTricker @NateScarlet /types/notifyjs-browser/ @bahman616 /types/notyf/ @gurov /types/nouislider/v7/ @acoreyj @@ -2722,6 +2857,7 @@ /types/npm/ @SomaticIT /types/npm-package-arg/ @mgroenhoff /types/npm-packlist/ @ajafff +/types/npmlog/ @DanielMSchmidt /types/ns-api/ @Archcry /types/nslog/ @unindented /types/nsqjs/ @cezaryrk @@ -2735,6 +2871,7 @@ /types/nw.gui/ @xperiments /types/nw.js/ @alirdn /types/o.js/ @IceOnFire @bradzacher @janhommes @jcchalte +/types/oauth/ @nonAlgebraic /types/oauth.js/ @nobuoka /types/oauth2-server/ @vangorra @cirick /types/oauth2orize/ @wokim @heycalmdown @stevehipwell @@ -2757,6 +2894,7 @@ /types/offline-js/ @cgwrench /types/oibackoff/ @geoffreak /types/oidc-token-manager/ @rosieks +/types/okta__okta-vue/ @innovation-team /types/ol/ @yairtawil /types/on-finished/ @czechboy0 @BendingBender /types/on-headers/ @jjeffery @BendingBender @@ -2772,7 +2910,7 @@ /types/openjscad/ @danmarshall /types/openlayers/v2/ @bolhovsky /types/openlayers/v3/ @osechet @matthiasdailey-ccri -/types/openlayers/ @osechet @wb14123 @ailrun @mylen @iamthechad @danmana @yairtawil @pierremarc +/types/openlayers/ @osechet @wb14123 @ailrun @mylen @iamthechad @danmana @yairtawil @pierremarc @hauke96 /types/openstack-wrapper/ @sanjaymadane /types/opentok/ @westy92 @CatGuardian /types/opentype.js/ @danmarshall @edzis @@ -2814,6 +2952,7 @@ /types/p-log/ @BendingBender /types/p-map/ @BendingBender /types/p-map-series/ @BendingBender +/types/p-memoize/ @forabi /types/p-one/ @BendingBender /types/p-props/ @BendingBender /types/p-queue/ @BendingBender @evanshortiss @@ -2845,7 +2984,7 @@ /types/parity-pmr/ @leovujanic /types/parity-poe/ @leovujanic /types/parse/ @dpoetzsch @jaeggerr @flavionegrao @wesleygrimes @owsas -/types/parse-git-config/ @leonard-thieu +/types/parse-git-config/ @leonard-thieu @deltaidea /types/parse-glob/ @glen-84 /types/parse-json/ @mrmlnc /types/parse-link-header/ @zelein @@ -2873,8 +3012,9 @@ /types/passport-local/ @SomaticIT /types/passport-local-mongoose/ @linusbrolin /types/passport-naver/ @Park9eon -/types/passport-oauth2/ @pasieronen +/types/passport-oauth2/ @pasieronen @WangZishi /types/passport-oauth2-client-password/ @akaNightmare +/types/passport-remember-me-extended/ @AylaJK /types/passport-saml/ @cjbarth /types/passport-steam/ @kzay /types/passport-strategy/ @liorm @@ -2896,6 +3036,7 @@ /types/pbf/ @cschwarz /types/pdfjs-dist/ @jbaldwin /types/pdfkit/ @erichillah +/types/pdfmake/ @m1llen1um @radziksh /types/pdfobject/ @nielsboogaard /types/pebblekitjs/ @makotokw /types/peer-dial/ @RealTYPICAL @@ -2908,6 +3049,7 @@ /types/pg/ @pspeter3 /types/pg-ears/ @bradleyayers /types/pg-escape/ @khell +/types/pg-format/ @zopf /types/pg-pool/ @aleung /types/pg-query-stream/ @asmarques /types/pg-types/ @waratuman @@ -2930,13 +3072,13 @@ /types/pickadate/ @theodorejb @leonard-thieu /types/picturefill/ @alaz /types/pidusage/ @cyrilschumacher -/types/pify/ @samverschueren @mad-mike +/types/pify/ @samverschueren @mad-mike @c7hm4r /types/pigpio/ @manerfan /types/pikaday/ @MidnightDesign @wake42 /types/pikaday-time/ @Sayan751 /types/pinkyswear/ @chances /types/pino/v3/ @psnider -/types/pino/ @psnider @BendingBender +/types/pino/ @psnider @BendingBender @screendriver /types/pino-multi-stream/ @JakeGinnivan /types/pinterest-sdk/ @adamburmister /types/pinyin/ @wanganjun @@ -2949,13 +3091,14 @@ /types/playerframework/ @ricardosabino /types/playmusic/ @nickp10 /types/pleasejs/ @nakakura -/types/plotly.js/ @chrisgervang @martinduparc @frederikaalund @taoqf @Dadstart @szechyjs +/types/plotly.js/ @chrisgervang @martinduparc @frederikaalund @taoqf @Dadstart @szechyjs @MercifulCode @soorajpudiyadath /types/plugapi/ @BNedry /types/plugin-error/ @rogierschouten /types/plupload/ @patrickbussmann /types/pluralize/ @ukyo /types/png-async/ @kanreisa /types/pngjs/ @jason0x43 +/types/pngquant-bin/ @hikoma /types/podcast/ @nikeee /types/podium/ @AJamesPhillips /types/point-in-polygon/ @dyst5422 @kogai @@ -2979,15 +3122,16 @@ /types/pouchdb-adapter-node-websql/ @spaulg @geppy @fredgalvao /types/pouchdb-adapter-websql/ @spaulg @geppy @fredgalvao /types/pouchdb-browser/ @spaulg @geppy @fredgalvao -/types/pouchdb-core/ @spaulg @trubit @geppy @fredgalvao @TobiasBales +/types/pouchdb-core/ @spaulg @trubit @geppy @fredgalvao @TobiasBales @tiangolo /types/pouchdb-find/ @trubit /types/pouchdb-http/ @spaulg @geppy @fredgalvao /types/pouchdb-mapreduce/ @spaulg @geppy @fredgalvao /types/pouchdb-node/ @spaulg @geppy @fredgalvao -/types/pouchdb-replication/ @trubit +/types/pouchdb-replication/ @trubit @tiangolo /types/pouchdb-upsert/ @keithdmoore @hotforfeature @apolkingg8 /types/power-assert/ @vvakame /types/power-assert-formatter/ @vvakame +/types/powerbi-visuals-tools/ @zBritva @Microsoft /types/precise/ @codeanimal /types/precond/ @olsio /types/preloadjs/ @endel @@ -3009,11 +3153,13 @@ /types/proj4leaflet/ @BendingBender /types/project-oxford/ @scsouthw /types/promise-dag/ @OSjoerdWie +/types/promise-map-limit/ @kohlmannj /types/promise-pg/ @coldacid /types/promise-polyfill/ @skysteve /types/promise-pool/ @vilic /types/promise-queue/ @LachlanStuart /types/promise-retry/ @shirakaba +/types/promise-timeout/ @Aankhen /types/promise.prototype.finally/ @slavik57 @BendingBender /types/promised-temp/ @rokadias /types/promisify-node/ @borekb @@ -3022,28 +3168,34 @@ /types/prompt-sync-history/ @MugeSo /types/promptly/ @danrspencer /types/prop-types/ @DovydasNavickas +/types/proper-lockfile/ @qlonik /types/properties-reader/ @Goldsmith42 -/types/prosemirror-collab/ @bradleyayers @davidka @timjb -/types/prosemirror-commands/ @bradleyayers @davidka @timjb -/types/prosemirror-gapcursor/ @bradleyayers @davidka @timjb -/types/prosemirror-history/ @bradleyayers @davidka @timjb -/types/prosemirror-inputrules/ @bradleyayers @davidka @timjb -/types/prosemirror-keymap/ @bradleyayers @davidka @timjb -/types/prosemirror-markdown/ @bradleyayers @davidka @timjb -/types/prosemirror-menu/ @bradleyayers @davidka @timjb -/types/prosemirror-model/ @bradleyayers @davidka @timjb @neknalb -/types/prosemirror-schema-basic/ @bradleyayers @davidka @timjb -/types/prosemirror-schema-list/ @bradleyayers @davidka @timjb -/types/prosemirror-state/ @bradleyayers @davidka @timjb -/types/prosemirror-tables/ @superchu @eshvedai -/types/prosemirror-transform/ @bradleyayers @davidka @timjb -/types/prosemirror-view/ @bradleyayers @davidka @timjb +/types/prosemirror-collab/ @bradleyayers @davidka @timjb @patsimm +/types/prosemirror-commands/ @bradleyayers @davidka @timjb @patsimm +/types/prosemirror-gapcursor/ @bradleyayers @davidka @timjb @patsimm +/types/prosemirror-history/ @bradleyayers @davidka @timjb @patsimm +/types/prosemirror-inputrules/ @bradleyayers @davidka @timjb @patsimm +/types/prosemirror-keymap/ @bradleyayers @davidka @timjb @patsimm +/types/prosemirror-markdown/ @bradleyayers @davidka @timjb @patsimm +/types/prosemirror-menu/ @bradleyayers @davidka @timjb @patsimm +/types/prosemirror-model/ @bradleyayers @davidka @timjb @neknalb @patsimm +/types/prosemirror-schema-basic/ @bradleyayers @davidka @timjb @patsimm +/types/prosemirror-schema-list/ @bradleyayers @davidka @timjb @patsimm +/types/prosemirror-state/ @bradleyayers @davidka @timjb @patsimm +/types/prosemirror-tables/ @superchu @eshvedai @patsimm +/types/prosemirror-transform/ @bradleyayers @davidka @timjb @patsimm +/types/prosemirror-view/ @bradleyayers @davidka @timjb @patsimm +/types/proton-native/ @khanhas /types/protractor-browser-logs/ @rokadias /types/protractor-helpers/ @johncant /types/protractor-http-mock/ @Crevil /types/provinces/ @gatimus /types/proxy-addr/ @BendingBender +/types/proxy-lists/ @BehindTheMath +/types/proxy-verifier/ @BehindTheMath /types/proxyquire/ @jt000 +/types/ps-tree/ @alessiopcc +/types/ptomasroos__react-native-multi-slider/ @Slessi /types/pty.js/ @enlight /types/public-ip/ @BendingBender /types/pubnub/ @bitbankinc @rollymaduk @vitosamson @@ -3051,6 +3203,7 @@ /types/pug/ @TonyPythoneer @19majkel94 /types/pulltorefreshjs/ @DanielRosenwasser @humpedli /types/pump/ @tlaziuk +/types/pumpify/ @JustinBeckwith @aoberoi /types/pupa/ @nju33 /types/puppeteer/v0/ @marvinhagemeister @cdeutsch /types/puppeteer/ @marvinhagemeister @cdeutsch @jwbay @@ -3077,13 +3230,14 @@ /types/quixote/ @greybax /types/qunit/v1/ @diullei /types/qunit/ @waratuman +/types/qunit-dom/ @happycollision /types/quoted-printable/ @pushplay /types/qwest/ @lindsayevans /types/r-script/ @NaridaL /types/rabbit.js/ @wokim /types/radium/ @alexgorbatchev @nupplaphil @asvetliakov @mihe /types/radius/ @codeanimal -/types/ramda/ @donnut @mdekrey @mrdziuban @sbking @afharo @teves-castro @1M0reBug @hojberg @charlespwd @samsonkeung @angeloocana @raynerd @googol @moshensky @ethanresnick @leighman +/types/ramda/ @donnut @tycho01 @mdekrey @mrdziuban @sbking @afharo @teves-castro @1M0reBug @hojberg @charlespwd @samsonkeung @angeloocana @raynerd @googol @moshensky @ethanresnick @leighman @CaptJakk @deftomat @deptno @blimusiek @biern /types/random-js/ @pistacchio /types/random-number/ @OpenByteDev /types/random-seed/ @endel @@ -3112,16 +3266,18 @@ /types/rc/ @DanielRosenwasser /types/rc-select/ @DenisTirilis /types/rc-slider/ @mantasmarcinkus @mattoni @paustint @j-fro -/types/rc-tree/ @johnnyreilly +/types/rc-tree/ @johnnyreilly @Methuselah96 /types/rcloader/ @panuhorsmalahti /types/rdf-data-model/ @rubensworks /types/rdf-js/ @rubensworks /types/react/v15/ @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz -/types/react/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz @theruther4d @guilhermehubner @joshuakgoldberg @jrakotoharisoa +/types/react/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @morcerf @tkrotoff @DovydasNavickas @onigoetz @theruther4d @guilhermehubner @ferdaber @jrakotoharisoa /types/react-alert/ @ssyrell /types/react-alice-carousel/ @endigo +/types/react-animate-on-scroll/ @ralbuque /types/react-app/ @prakarshpandey /types/react-aria-menubutton/ @forabi @crohlfs +/types/react-autocomplete/ @lstanden /types/react-autosuggest/ @nicolas-schmitt @pjo256 @robessog @tbayne @cdeutsch @rosskevin /types/react-avatar-editor/ @diogocorrea @gabsprates /types/react-beautiful-dnd/ @varHarrie @bradleyayers @paustint @@ -3140,13 +3296,16 @@ /types/react-calendar-heatmap/ @9renpoto /types/react-calendar-timeline/ @radziksh /types/react-cartographer/ @trevonmckay +/types/react-circular-progressbar/ @lstanden /types/react-click-outside/ @screendriver /types/react-codemirror/ @velveret @rudi-c /types/react-collapse/ @Kimahriman +/types/react-collapsible/ @knegusen /types/react-color/ @LKay @markspolakovs @mntdn /types/react-confirm/ @santiagodoldan -/types/react-content-loader/ @alaatm +/types/react-content-loader/ @alaatm @samwalshnz /types/react-copy-to-clipboard/ @mabels @BernabeFelix +/types/react-credit-cards/ @vstrimaitis /types/react-cropper/ @stepancar /types/react-css-modules/ @KostyaEsmukov @skirsdeda /types/react-css-transition-replace/ @LKay @@ -3176,7 +3335,7 @@ /types/react-event-listener/ @asvetliakov /types/react-fa/ @flaub @patsissons @LKay /types/react-facebook-login/ @apare @jankarres -/types/react-faux-dom/ @alitaheri @cleverguy25 @deviousm +/types/react-faux-dom/ @alitaheri @cleverguy25 @deviousm @hanai /types/react-file-input/ @dmitryrogozhny /types/react-file-reader-input/ @dmitryrogozhny @alitaheri /types/react-flags-select/ @senukartur @@ -3188,6 +3347,8 @@ /types/react-form/ @cameron-mcateer @TiuSh /types/react-foundation/ @danielearwicker /types/react-geosuggest/ @brmenchl +/types/react-google-maps-loader/ @vasilysn +/types/react-google-places-suggest/ @vasilysn /types/react-google-recaptcha/ @KoalaHuman /types/react-gravatar/ @invliD /types/react-grid-layout/ @abirkholz @alitaheri @ZheyangSong @andrewhathaway @@ -3198,13 +3359,14 @@ /types/react-highlight-words/ @mhegazy /types/react-highlighter/ @oizie /types/react-holder/ @isman-usoh -/types/react-hot-loader/ @jacekjagiello +/types/react-hot-loader/ @jacekjagiello @MartynasZilinskas @DovydasNavickas /types/react-hyperscript/ @tock203 /types/react-i18next/v1/ @KostyaEsmukov /types/react-i18next/v4/ @GiedriusGrabauskas /types/react-i18next/ @GiedriusGrabauskas @chnoch /types/react-icon-base/ @apare @LKay /types/react-icons/ @apare @johnnyreilly @LKay +/types/react-image-crop/ @danielasy /types/react-image-gallery/ @adamwpc /types/react-imageloader/ @stephenjelfs /types/react-infinite/ @rhysd @@ -3215,6 +3377,7 @@ /types/react-intl/v1/ @bgrieder /types/react-intl/ @bgrieder @cdroulers @gyzerok @tillwolff @LKay @bhouser @kristerkari @formatlos /types/react-intl-redux/ @LKay +/types/react-is/ @AviVahl /types/react-is-deprecated/ @seansfkelley /types/react-joyride/ @DanielRosenwasser @bendxn /types/react-json/ @spielc @@ -3234,18 +3397,18 @@ /types/react-measure/ @asvetliakov @marcfallows /types/react-mixin/ @tkqubo /types/react-modal/ @radziksh @drewnoakes @homburg @ttamminen @hallowatcher @peterblazejewicz -/types/react-monaco-editor/ @jnetterf /types/react-motion/ @stepancar @asvetliakov @dimitarnestorov /types/react-motion-slider/ @asvetliakov -/types/react-native/ @alloy @huhuanming @iRoachie @timwangdev @kamal @nelyousfi @alexdunne @swissmanu @bm-software +/types/react-native/ @alloy @huhuanming @iRoachie @timwangdev @kamal @nelyousfi @alexdunne @swissmanu @bm-software @tkrotoff /types/react-native-android-taskdescription/ @christianchown /types/react-native-auth0/ @ascariandrea -/types/react-native-collapsible/ @iRoachie @umidbekkarimov +/types/react-native-autocomplete-input/ @ifiokjr +/types/react-native-bluetooth-serial/ @RodrigoAWeber /types/react-native-communications/ @huhuanming @PaitoAnderson /types/react-native-datepicker/ @jacobbaskin /types/react-native-doc-viewer/ @iRoachie /types/react-native-document-picker/ @plantain-00 -/types/react-native-drawer/ @jnbt +/types/react-native-drawer/ @jnbt @suniahk /types/react-native-drawer-layout/ @jmfirth /types/react-native-elevated-view/ @fhelwanger /types/react-native-fabric/ @josephroque @@ -3253,15 +3416,20 @@ /types/react-native-fetch-blob/ @MNBuyskih /types/react-native-fs/ @pocesar @josephroque /types/react-native-google-signin/ @j-fro +/types/react-native-htmlview/ @ifiokjr /types/react-native-i18n/ @VincentLanglet +/types/react-native-indicators/ @ifiokjr /types/react-native-keep-awake/ @huhuanming -/types/react-native-linear-gradient/ @j-fro +/types/react-native-keyboard-spacer/ @VincentLanglet +/types/react-native-keychain/ @DavidFarinha /types/react-native-loading-spinner-overlay/ @fhelwanger /types/react-native-material-design-searchbar/ @iRoachie /types/react-native-material-kit/ @iRoachie @timwangdev +/types/react-native-material-textfield/ @mindhivefi /types/react-native-material-ui/ @iRoachie /types/react-native-mixpanel/ @r3nya /types/react-native-modalbox/ @iRoachie +/types/react-native-multi-slider/ @Slessi /types/react-native-navigation/ @egorshulga /types/react-native-orientation/ @MoLow /types/react-native-permissions/ @vincentlanglet @@ -3274,7 +3442,7 @@ /types/react-native-sensor-manager/ @SahinVardar /types/react-native-snap-carousel/ @jnbt @j-fro @gazaret /types/react-native-sortable-grid/ @j-fro -/types/react-native-sortable-list/ @sivolobov +/types/react-native-sortable-list/ @sivolobov @RookY2K /types/react-native-sqlite-storage/ @dryganets /types/react-native-star-rating/ @iRoachie /types/react-native-svg-uri/ @iRoachie @@ -3286,7 +3454,8 @@ /types/react-native-vector-icons/ @iRoachie @timwangdev /types/react-native-version-number/ @VincentLanglet /types/react-native-video/ @huhuanming -/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @robertohuertasm @YourGamesBeOver @ArmandoAssuncao @cliedeman +/types/react-navigation/v1/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @robertohuertasm @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi +/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @robertohuertasm @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi @magrinj /types/react-notification-system/ @GiedriusGrabauskas @DeividasBakanas @LKay @sztobar /types/react-notification-system-redux/ @LKay /types/react-numeric-input/ @heatherbooker @@ -3294,31 +3463,36 @@ /types/react-onclickoutside/ @LKay /types/react-onsenui/ @salim7 @jemmyw /types/react-overlays/ @aaronbeall @vitosamson +/types/react-owl-carousel/ @tbounsiar @igorissen @KennethanCeyer /types/react-paginate/ @deevus @wouterhardeman @pegel03 @archy-bold /types/react-places-autocomplete/ @guilhermehubner /types/react-pointable/ @istefo @mdibyo +/types/react-popover/ @jacoporicare /types/react-portal/ @shuntksh /types/react-props-decorators/ @tkqubo +/types/react-radio-group/ @jsonunger /types/react-recaptcha/ @mhegazy @zzanol -/types/react-redux/ @tkqubo @thasner @kenzierocks @clayne11 @tansongyang @nicholasboll @mdibyo @pdeva +/types/react-redux/v5/ @tkqubo @thasner @kenzierocks @clayne11 @tansongyang @nicholasboll @mdibyo @pdeva +/types/react-redux/ @tkqubo @thasner @kenzierocks @clayne11 @tansongyang @nicholasboll @mdibyo @pdeva @kallikrein @val1984 @jrakotoharisoa /types/react-redux-epic/ @forabi /types/react-redux-i18n/ @clementdevos /types/react-redux-toastr/ @Smiche @artyomsv @kulmajaba -/types/react-relay/ @graphcool @voxmatt @alloy @npirotte -/types/react-resize-detector/ @matthew-matvei +/types/react-relay/ @graphcool @voxmatt @alloy @npirotte @ckknight +/types/react-resize-detector/ @matthew-matvei @aMoniker /types/react-resolver/ @forabi /types/react-responsive/v1/ @asvetliakov /types/react-responsive/ @asvetliakov @alechill @xaviergonz /types/react-rnd/ @Ragg- /types/react-router/v2/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov /types/react-router/v3/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @ssorallen -/types/react-router/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @tkrotoff @huy-nguyen @grmiade @DaIgeb @egorshulga @neuoy @rraina +/types/react-router/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @tkrotoff @huy-nguyen @grmiade @DaIgeb @egorshulga @neuoy @rraina @pret-a-porter /types/react-router-bootstrap/ @vlesierse @LKay @olmobrutall /types/react-router-config/ @lith-light-g /types/react-router-dom/ @tkrotoff @huy-nguyen @p-jackson /types/react-router-native/ @ezintz @fhelwanger /types/react-router-navigation/ @kaoDev /types/react-router-navigation-core/ @kaoDev +/types/react-router-param-link/ @mtsg /types/react-router-redux/v3/ @isman-usoh @noah79 @rosendi /types/react-router-redux/v4/ @isman-usoh @noah79 @rosendi @LKay @DovydasNavickas /types/react-router-redux/ @huy-nguyen @8398a7 @mykolas @@ -3326,6 +3500,7 @@ /types/react-scroll/ @sudoplz @GiedriusGrabauskas /types/react-scrollbar/ @stephenjelfs /types/react-select/ @Hesquibet @giladgray @iebaker @skirsdeda @vujevits @devrelm @MartynasZilinskas @onatm @ninjaferret @tehbi4 @misantronic @darkartur +/types/react-share/ @icopp /types/react-side-effect/ @remojansen /types/react-sidebar/ @jeroenvervaeke /types/react-sketchapp/ @ricokahler @DomiR @@ -3333,12 +3508,13 @@ /types/react-smooth-scrollbar/ @asvetliakov /types/react-sortable-hoc/ @NoHomey @charlesrey /types/react-sortable-pane/ @rhysd -/types/react-sortable-tree/ @wouterhardeman @jzoric +/types/react-sortable-tree/ @wouterhardeman @jzoric @kevinsperrine /types/react-spinkit/v1/ @tkqubo @mleko @pelotom /types/react-spinkit/ @tkqubo @mleko @pelotom @zzanol /types/react-sticky/ @curtisw0 +/types/react-stickynode/ @tstirrat /types/react-stripe-elements/ @dan-j @santiagodoldan @sonnysangha @9y5 @thchia -/types/react-svg/ @viccrubs +/types/react-svg/ @viccrubs @chrisgarber /types/react-svg-pan-zoom/ @huy-nguyen /types/react-swf/ @stepancar /types/react-swipe/ @DeividasBakanas @@ -3354,9 +3530,11 @@ /types/react-test-renderer/v15/ @arvitaly @lochbrunner @lochbrunner @johnnyreilly /types/react-test-renderer/ @arvitaly @lochbrunner @johnnyreilly @jgoz /types/react-tether/ @ryprice -/types/react-text-mask/ @guilhermehubner +/types/react-text-mask/ @guilhermehubner @cavarzan /types/react-textarea-autosize/ @asvetliakov @zry656565 -/types/react-toastr/ @shssoichiro +/types/react-timeout/ @kerwynrg +/types/react-toastify/ @icopp +/types/react-toastr/ @shssoichiro @DanRegazzi /types/react-toggle/v2/ @LKay /types/react-toggle/ @LKay /types/react-tooltip/ @DeividasBakanas @@ -3376,10 +3554,11 @@ /types/react-widgets/ @rogierschouten @sanyatuning @frodehansen2 @r3nya /types/react-widgets-moment/ @dawnmist /types/react-youtube/ @kgtkr +/types/react-youtube-embed/ @charles-salmon /types/reactable/ @spielc /types/reactcss/ @chrisgervang @LKay /types/reactstrap/v4/ @alihammad @mfal @danilobjr @fabiopaiva -/types/reactstrap/ @alihammad @mfal @danilobjr @fabiopaiva @FaithForHumans @KurtPreston @timc13 +/types/reactstrap/ @alihammad @mfal @danilobjr @FaithForHumans @KurtPreston @timc13 @patrickrgaffney /types/read/ @timjk /types/read-chunk/ @crispybee /types/read-package-tree/ @mgroenhoff @@ -3390,10 +3569,11 @@ /types/readline-sync/ @jonestristand /types/readline-transform/ @dex4er /types/reapop/ @Barrokgl +/types/recaptcha2/ @l-jonas /types/recase/ @18steps /types/recharts/ @mthmulders @rapmue @royxue @ZheyangSong @richbai90 @caspeco-dan /types/recluster/ @dex4er -/types/recompose/ @iskandersierra @mrapogee @clayne11 @Pajn +/types/recompose/ @iskandersierra @mrapogee @clayne11 @Pajn @lucasterra /types/reconnectingwebsocket/ @nguarracino /types/recursive-readdir/v1/ @elisee /types/recursive-readdir/ @elisee @MicahZoltu @@ -3408,7 +3588,7 @@ /types/reduce-reducers/ @huy-nguyen /types/redux-action/ @newraina /types/redux-action-utils/ @tkqubo -/types/redux-actions/ @jaysoo @alexgorbatchev @alechill +/types/redux-actions/ @jaysoo @alexgorbatchev @alechill @alexey-pelykh /types/redux-auth-wrapper/v1/ @LKay /types/redux-auth-wrapper/ @LKay /types/redux-batched-subscribe/ @mDibyo @@ -3419,6 +3599,7 @@ /types/redux-doghouse/ @BendingBender /types/redux-first-router/ @Valbrand @viggyfresh @janb87 @corydeppen /types/redux-first-router-link/ @janb87 +/types/redux-first-router-restore-scroll/ @icopp /types/redux-form/v4/ @aikoven /types/redux-form/v6/ @carsonf @aikoven @LKay @bancek /types/redux-form/ @carsonf @aikoven @LKay @bancek @alsiola @tehbi4 @huwmartin @@ -3433,13 +3614,14 @@ /types/redux-logger/ @arusakov @kgroat /types/redux-mock-store/ @MarianPalkus /types/redux-optimistic-ui/ @asvetliakov -/types/redux-pack/ @tansongyang -/types/redux-persist-transform-encrypt/ @LKay +/types/redux-pack/ @tansongyang @quicksnap @no-stack-dub-sack +/types/redux-persist-transform-encrypt/ @LKay @dante-101 /types/redux-persist-transform-filter/ @LKay /types/redux-promise/ @molekilla @xStrom /types/redux-promise-middleware/ @ianks /types/redux-recycle/ @LKay /types/redux-router/ @stepancar +/types/redux-shortcuts/ @tstirrat /types/redux-socket.io/ @snakeego /types/redux-storage/ @asvetliakov /types/redux-storage-engine-jsurl/ @screendriver @@ -3457,8 +3639,10 @@ /types/remarkable/ @makepost /types/remote-redux-devtools/ @ColinEberhardt @unindented /types/remove-markdown/ @RagibHasin +/types/rename/ @Aankhen /types/replace-ext/ @DeividasBakanas /types/request/ @soywiz @bonnici @Bartvds @joeskeen @ccurrens @lookfirst @mastermatt +/types/request-as-curl/ @atd-schubert /types/request-ip/ @mrhen /types/request-promise/ @cglantschnig @joeskeen @AyaMorisawa @mastermatt /types/request-promise-native/ @gustavohenke @mastermatt @@ -3479,7 +3663,7 @@ /types/restangular/ @borisyankov /types/restful.js/ @tkqubo /types/restify/v4/ @blittle @stevehipwell -/types/restify/ @blittle @stevehipwell +/types/restify/ @blittle @stevehipwell @leanazulyoro /types/restify-cookies/ @weekens /types/restify-cors-middleware/ @dthunell /types/restify-errors/ @stevehipwell @@ -3487,7 +3671,7 @@ /types/restler/ @cyrilschumacher /types/restling/ @loghorn /types/resumablejs/ @DanielMcAssey -/types/rethinkdb/ @alexgorbatchev @AdrianFarmadin +/types/rethinkdb/ @alexgorbatchev @AdrianFarmadin @kondi @hoishin /types/retry/ @krenor /types/retry-as-promised/ @Raigen /types/rev-hash/ @ikatyang @@ -3508,8 +3692,10 @@ /types/riotjs/ @vvakame /types/rison/ @impworks /types/rivets/ @TrevorDev @matjanos +/types/rmfr/ @pluma /types/roads/ @dancespiele /types/roads-server/ @dancespiele +/types/roll/ @icopp /types/rollup-plugin-json/ @asmockler /types/ronomon__crypto-async/ @BendingBender /types/rosie/ @abner @subvertallchris @abukurov @@ -3526,7 +3712,9 @@ /types/rsvp/ @chriskrycho /types/rsync/ @philippstucki /types/rtree/ @oefirouz +/types/run-parallel/ @mrmlnc /types/run-sequence/ @k-kagurazaka +/types/rword/ @icopp /types/rx/ @Igorbek /types/rx-angular/ @mickdelaney /types/rx-core/ @Igorbek @mizunashi-mana @@ -3568,6 +3756,8 @@ /types/satnav/ @DotNetNerd /types/saywhen/ @SeanSobey /types/scalike/ @ryoppy +/types/schema-registry/ @bonzzy +/types/schwifty/ @ozum /types/screenfull/ @icholy @lionelb @joelshepherd /types/screeps/ @MarkoSulamagi @NhanHo @bryanbecker @resir014 @Arcath @apemanzilla /types/screeps-profiler/ @ramblurr @@ -3580,11 +3770,13 @@ /types/scryptsy/ @micksatana /types/seamless/ @danmana /types/seamless-immutable/ @alex3165 @xsburg @geirsagberg +/types/secp256k1/ @anler +/types/seed-random/ @l-jonas /types/seededshuffle/ @urish /types/seedrandom/ @kernhanda /types/segment-analytics/ @fongandrew /types/select2/v3/ @borisyankov -/types/select2/ @borisyankov +/types/select2/ @borisyankov @denisname /types/selectables/ @renjfk /types/selectize/ @adidahiya @naBausch /types/selenium-webdriver/v2/ @BillArmstrong @Kuniwak @cnishina @@ -3614,6 +3806,7 @@ /types/semver/ @Bartvds @BendingBender @LucianBuzzo /types/semver-compare/ @vincekovacs /types/semver-diff/ @chrismbarr +/types/semver-sort/ @LogvinovLeon /types/sencha_touch/ @brian428 /types/send/ @MikeJerred /types/seneca/ @psnider @kevynb @@ -3642,7 +3835,8 @@ /types/sheetify/ @toddself /types/shell-escape/ @nenadalm /types/shell-quote/ @jason0x43 -/types/shelljs/ @nikeee @voy +/types/shelljs/ @nikeee @voy @gkalpak @pheromonez +/types/shelljs-exec-proxy/ @qlonik /types/shimmer/ @kjin /types/shipit/ @cyrilschumacher /types/shipit-utils/ @cyrilschumacher @@ -3664,7 +3858,7 @@ /types/simple-cw-node/ @vvakame /types/simple-lru/ @NN--- /types/simple-mock/ @leonyu -/types/simple-oauth2/ @mad-mike +/types/simple-oauth2/ @mad-mike @troy-lamerton /types/simple-peer/ @tlaziuk /types/simple-url-cache/ @a-lucas /types/simple-websocket/ @dex4er @@ -3675,7 +3869,7 @@ /types/simplesmtp/ @rogierschouten /types/simplestorage.js/ @axelcostaspena @mxl /types/single-line-log/ @ffflorian -/types/sinon/ @mrbigdog2u @rationull @lumaxis @nicojs @43081j +/types/sinon/ @mrbigdog2u @rationull @lumaxis @nicojs @43081j @joshuakgoldberg /types/sinon-as-promised/ @igrayson /types/sinon-chai/ @kazimanzurrashid @jedmao /types/sinon-chrome/ @pimterry @crimx @kobanyan @@ -3709,8 +3903,8 @@ /types/smtpapi/ @a-morales /types/snapsvg/ @lhk @mattanja @kant2002 /types/snazzy-info-window/ @milosd92 -/types/snekfetch/ @DarkerTV -/types/snoowrap/ @vitosamson +/types/snekfetch/ @DarkerTV @ShayBox @Dev-Yukine +/types/snoowrap/ @vitosamson @TheAppleFreak /types/snowboy/ @dolanmiu /types/socket.io/ @progre @divillysausages @florentpoujol @KentarouTakeda @gigi /types/socket.io-client/ @progre @divillysausages @florentpoujol @@ -3722,6 +3916,8 @@ /types/socketty/ @Nax /types/sockjs/ @pmccloghrylaing /types/sockjs-client/ @vladev @arusakov @BendingBender @renjfk +/types/solidity-parser-antlr/ @LogvinovLeon +/types/solr-client/ @liul85 /types/solution-center-communicator/ @dami-gg /types/sort-array/ @mrmlnc /types/sortablejs/ @Maw-Fox @@ -3733,7 +3929,7 @@ /types/spark-md5/ @bastienmoulia /types/sparkly/ @BendingBender /types/sparkpost/v1/ @geoffreak -/types/sparkpost/ @geoffreak @bondz +/types/sparkpost/ @geoffreak @bondz @vvu /types/sparqljs/ @AlexeyMz /types/spatialite/ @atd-schubert /types/spdx-correct/ @jinwoo @@ -3766,6 +3962,7 @@ /types/stack-utils/ @BendingBender /types/stacktrace-js/ @exceptionless @pilagod /types/stale-lru-cache/ @cxcorp +/types/stampit/v2/ @koresar /types/stampit/ @koresar /types/stamplay-js-sdk/ @ridermansb /types/stat-mode/ @BendingBender @@ -3791,7 +3988,8 @@ /types/storybook__addon-knobs/ @joscha @martynaskadisa /types/storybook__addon-links/ @joscha @jessepinho /types/storybook__addon-notes/ @joscha -/types/storybook__addon-options/ @joscha +/types/storybook__addon-options/ @joscha @simonhn +/types/storybook__addon-storyshots/ @bradleyayers /types/storybook__react/ @joscha @wapgear /types/storybook__vue/ @pntgupta /types/stream-buffers/ @Jason3S @@ -3826,27 +4024,32 @@ /types/stylelint/ @alan-agius4 /types/stylelint-webpack-plugin/ @bahlo /types/stylus/ @SomaticIT +/types/subscribe-ui-event/ @wangcheng678 /types/subsume/ @BendingBender /types/succinct/ @EnableSoftware /types/sudo-block/ @BendingBender /types/suitescript/ @darrenhillconsulting /types/sumo-logger/ @forabi @clementallen /types/superagent/v2/ @varju @NicoZelaya @mxl -/types/superagent/ @NicoZelaya @mxl @paplorinc @shreyjain1994 +/types/superagent/ @NicoZelaya @mxl @paplorinc @shreyjain1994 @zopf /types/superagent-no-cache/ @mxl /types/superagent-prefix/ @mxl /types/supercluster/ @DenisCarriere /types/supertest/ @varju /types/supertest-as-promised/ @tkrotoff -/types/supports-color/ @mgroenhoff +/types/supports-color/v3/ @mgroenhoff +/types/supports-color/ @mgroenhoff @mtraynham /types/svg-injector/ @poke /types/svg-parser/ @mrmlnc +/types/svg-path-bounding-box/ @NotWoods /types/svg-sprite/ @tkqubo /types/svg2png/ @hansrwindhoff @sccgithub /types/svg4everybody/ @BendingBender /types/svgjs.draggable/ @LiFeleSs /types/svgjs.resize/ @jkevingutierrez -/types/svgo/ @bradleyayers @giladgray +/types/svgo/ @bradleyayers @giladgray @Aankhen +/types/sw-precache/ @JounQin +/types/sw-precache-webpack-plugin/ @JounQin /types/swag/ @shiwano /types/swagger-express-middleware/ @alexandreroba /types/swagger-express-mw/ @micmro @@ -3860,12 +4063,14 @@ /types/swagger-schema-official/ @mohsen1 @bsouthga @nimerritt /types/swagger-tools/ @bricka /types/swaggerize-express/ @mugeso @nickmorton +/types/swe-validation/ @hjalmers /types/swfobject/ @rou /types/swiftclick/ @Laurence-C /types/swig/ @CodeAnimal @soywiz /types/swig-email-templates/ @mrhen @micksatana /types/swipe/ @kant2002 -/types/swiper/ @sgaliano @lucax88x +/types/swiper/v3/ @sgaliano @lucax88x +/types/swiper/ @sgaliano @lucax88x @ematseruk /types/swipeview/ @borisyankov /types/switchery/ @bgrieder @claylaut /types/swiz/ @jedigo @@ -3874,14 +4079,17 @@ /types/systeminformation/ @PixelcrabAT /types/systemjs/ @ludohenin @NathanWalker @GiedriusGrabauskas @aluanhaddad /types/table/ @evanshortiss @mrmlnc +/types/tableau/ @protip /types/tabris-plugin-firebase/ @eclipsesource /types/tabtab/ @vojtechhabarta /types/tabulator/ @euginio +/types/tail/ @spacejack /types/tapable/v0/ @e-cloud /types/tapable/ @e-cloud /types/tape/ @Bartvds @sodatea @DennisSchwartz @mikehenrty /types/tar/ @SomaticIT @connor4312 /types/tar-fs/ @Umoxfo +/types/tar-stream/ @glicht /types/tcp-ping/ @stegano /types/tedious/ @rogierschouten @cjthompson /types/tedious-connection-pool/ @sandorfr @@ -3898,8 +4106,9 @@ /types/text-buffer/ @GlenCFL /types/text-encoding/ @pine613 /types/text-encoding-utf-8/ @trxcllnt +/types/text-table/ @saadq /types/textarea-caret/ @shiftkey -/types/three/ @gyohk @florentpoujol @SereznoKot @omni360 @ivoisbelongtous @piranha771 @qszhusightp @nakakura @s093294 @Pro @efokschaner @PsychoSTS @dhritzkiv @apurvaojas +/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 @@ -3930,19 +4139,26 @@ /types/to-title-case-gouch/ @stpettersens /types/toastr/ @borisyankov /types/tocktimer/ @evanshortiss +/types/tokgen/ @l-jonas +/types/toobusy-js/ @atd-schubert /types/tooltipster/ @stephenlautier @pjmagee @VorobeY1326 @leonard-thieu @janhi @joeskeen /types/topojson/ @ricardo-mello @chenzhutian @denisname +/types/topojson-client/ @denisname @ricardo-mello +/types/topojson-simplify/ @denisname @ricardo-mello +/types/topojson-specification/ @denisname /types/torrent-stream/ @xstoudi /types/touch/ @mizunashi-mana @BendingBender /types/touch-events/ @kevinb7 -/types/tough-cookie/ @leonard-thieu @LiJinyao +/types/tough-cookie/ @leonard-thieu @LiJinyao @no2chem /types/traceback/ @misak113 /types/tracking/ @pimterry /types/transducers-js/ @colinkahn @dphilipson @NaridaL /types/transducers.js/ @dphilipson +/types/transliteration/ @tony19 /types/trash/ @matthew-matvei @hoishin /types/traverse/ @newclear /types/traverson/ @marcinporebski +/types/travis-fold/ @andy-ms /types/trayballoon/ @korve /types/tress/ @sindilevich /types/trim/ @skysteve @@ -3953,7 +4169,7 @@ /types/tus-js-client/ @kevhiggins /types/tv4/ @Bartvds @psnider /types/tween.js/ @Amos47 @sunetos @jzarnikov @alexburner -/types/tweenjs/ @evilangelist +/types/tweenjs/ @evilangelist @jcyuan /types/tweezer.js/ @praxxis /types/twig/ @soywiz @enko /types/twilio/ @nickiannone @ashleybrener @@ -3968,6 +4184,7 @@ /types/type-is/ @BendingBender /types/type-name/ @armorik83 /types/typeahead/ @igochkov @gjunge +/types/typed.js/ @Dona278 /types/typedarray-pool/ @pawsong /types/typeof/ @OpenByteDev /types/typescript-deferred/ @DirtyHairy @@ -4004,7 +4221,7 @@ /types/untildify/ @BendingBender /types/unused-filename/ @BendingBender /types/unzip/ @coding2012 -/types/unzipper/ @s73obrien +/types/unzipper/ @s73obrien @natemara /types/update-notifier/v1/ @vvakame @nchen63 /types/update-notifier/ @vvakame @nchen63 @bitjson /types/upng-js/ @plantain-00 @@ -4016,8 +4233,10 @@ /types/url-assembler/ @wolfgang42 /types/url-join/ @rogierschouten @devrelm /types/url-metadata/ @mrkmg +/types/url-params/ @danielsogl /types/url-parse/ @ChernenkoPaul /types/url-regex/ @unindented +/types/url-safe-base64/ @johngeorgewright /types/url-search-params/ @nick121212 @nrathi /types/url-template/ @marcinporebski /types/urllib/ @sorayama @@ -4043,7 +4262,7 @@ /types/valerie/ @conficient /types/vali-date/ @SamVerschueren /types/valid-url/ @stevehipwell -/types/validator/ @tgfjt @chrootsu @IOAyman @louy @kacepe @deptno @builtinnya +/types/validator/ @tgfjt @chrootsu @IOAyman @louy @kacepe @deptno @builtinnya @qqilihq /types/validatorjs/ @LKay @danmana /types/vanilla-modal/ @samnau /types/vanilla-tilt/ @BrunnerLivio @@ -4060,7 +4279,7 @@ /types/vfile/ @bizen241 @rokt33r /types/vfile-location/ @ikatyang /types/victory/ @asvetliakov @snerks @Havret -/types/video.js/ @vbortone @scleriot @SWBennett06 @IgelCampus +/types/video.js/ @vbortone @scleriot @SWBennett06 @IgelCampus @giofreitas /types/viewability-helper/ @lironzluf /types/viewerjs/ @lrh3321 /types/viewporter/ @borisyankov @@ -4085,6 +4304,7 @@ /types/voronoi-diagram/ @michaelneu /types/vortex-web-client/ @Pro /types/voximplant-websdk/ @aylarov +/types/vue-markdown/ @neodon /types/vue-resource/ @kaorun343 /types/vue-scrollto/ @vincekovacs /types/vuex-i18n/ @jaeggerr @@ -4119,11 +4339,11 @@ /types/webdriverio/ @nmalaguti @timbru31 @fsmedberg-tc @tanvirislam06 @phil-lgr /types/webfontloader/ @doskallemaskin /types/webgl-ext/ @zenmumbler -/types/webgl2/ @nkemnitz +/types/webgl2/ @nkemnitz @karhu /types/webidl2/ @saschanaz /types/webmidi/ @lostfictions -/types/webpack/v3/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @ahmed-taj @alan-agius4 @elliottsj @jason0x43 -/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @ahmed-taj @alan-agius4 @elliottsj @jason0x43 @dennispg +/types/webpack/v3/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @ahmed-taj @alan-agius4 @elliottsj @jason0x43 @christophehurpeau +/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @ahmed-taj @alan-agius4 @elliottsj @jason0x43 @dennispg @christophehurpeau /types/webpack-bundle-analyzer/ @kryops /types/webpack-chain/ @eirikurn @psachs21 /types/webpack-chunk-hash/ @mtraynham @@ -4154,7 +4374,7 @@ /types/weixin-app/ @taoqf @AlexStacker /types/wellknown/ @yairtawil /types/whatwg-mimetype/ @petejohanson -/types/whatwg-streams/ @saschanaz +/types/whatwg-streams/ @saschanaz @ksm2 /types/whatwg-url/ @aomarks /types/wheel/ @BTOdell /types/when/ @derekcicerone @Nemo157 @@ -4164,6 +4384,7 @@ /types/window-or-global/ @vvakame /types/window-size/ @pmkary /types/windows-1251/ @RomanGolovanov +/types/windows-script-host/ @zspitz /types/windows-service/ @rogierschouten /types/winjs/v1/ @adamhewitt627 @craigktreasure @xirzec /types/winjs/v2/ @adamhewitt627 @craigktreasure @xirzec @@ -4182,9 +4403,11 @@ /types/wpapi/ @guoyunhe /types/wrap-ansi/v2/ @kayahr /types/wrap-ansi/ @kayahr -/types/wreck/ @marcinporebski +/types/wreck/v7/ @marcinporebski +/types/wreck/ @marcinporebski @saboya /types/wrench/ @soywiz /types/write-file-atomic/ @BendingBender +/types/write-file-atomically/ @Aankhen /types/write-json-file/ @DenisCarriere /types/write-pkg/ @azasypkin /types/ws/ @loyd @elithrar @mlamp @TitaneBoy @orblazer @@ -4233,9 +4456,10 @@ /types/youtube/ @DazWilkin @JoshuaKGoldberg @eliotfallon213 /types/youtube-dl/ @bsurai /types/yui/ @giabao -/types/yup/ @dhardtke @vtserman @MoretonBayRC +/types/yup/ @dhardtke @vtserman @MoretonBayRC @sseppola /types/z-schema/ @pgonzal /types/zapier-platform-core/ @bradleyayers +/types/zeit__next-typescript/ @icopp /types/zen-observable/ @aicest /types/zen-push/ @daprahamian /types/zenscroll/ @HamedFathi @@ -4251,5 +4475,6 @@ /types/zipkin-transport-http/ @plantain-00 /types/zmq/ @davemckeown /types/zookeeper/ @xialeistudio +/types/zopflipng-bin/ @hikoma /types/zui/ @yuanxu /types/zxcvbn/ @mtraynham diff --git a/.gitignore b/.gitignore index c8e25cec8d..ac63b6f6b5 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,6 @@ npm-debug.log # yarn yarn.lock + +# pnpm +shrinkwrap.yaml diff --git a/README.es.md b/README.es.md index ce94bb0298..c3cff967db 100644 --- a/README.es.md +++ b/README.es.md @@ -87,6 +87,7 @@ Primero, haz un [fork](https://guides.github.com/activities/forking/) en este re * `cd types/my-package-to-edit` * Haz cambios. Recuerda editar las pruebas. + Si realiza cambios importantes, no olvide [actualizar una versión principal](#quiero-actualizar-un-paquete-a-una-nueva-versión-principal). * También puede que quieras añadirte la sección "Definitions by" en el encabezado del paquete. - Esto hará que seas notificado (a través de tu nombre de usuario en GitHub) cada vez que alguien haga un pull request o issue sobre el paquete. - Haz esto añadiendo tu nombre al final de la línea, así como en `// Definitions by: Alice , Bob `. diff --git a/README.md b/README.md index 7c58fe8901..8e582f05b4 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,7 @@ First, [fork](https://guides.github.com/activities/forking/) this repository, in * `cd types/my-package-to-edit` * Make changes. Remember to edit tests. + If you make breaking changes, do not forget to [update a major version](#i-want-to-update-a-package-to-a-new-major-version). * You may also want to add yourself to "Definitions by" section of the package header. - This will cause you to be notified (via your GitHub username) whenever someone makes a pull request or issue about the package. - Do this by adding your name to the end of the line, as in `// Definitions by: Alice , Bob `. @@ -120,7 +121,7 @@ Your package should have this structure: | tsconfig.json | This allows you to run `tsc` within the package. | | tslint.json | Enables linting. | -Generate these by running `npm install -g dts-gen` and `dts-gen --dt --name my-package-name --template module`. +Generate these by running `npx dts-gen --dt --name my-package-name --template module` if you have npm ≥ 5.2.0, `npm install -g dts-gen` and `dts-gen --dt --name my-package-name --template module` otherwise. See all options at [dts-gen](https://github.com/Microsoft/dts-gen). You may edit the `tsconfig.json` to add new files, to add `"target": "es6"` (needed for async functions), to add to `"lib"`, or to add the `"jsx"` compiler option. diff --git a/notNeededPackages.json b/notNeededPackages.json index 6f3e4fe093..f3dc9ef37f 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -124,7 +124,7 @@ "libraryName": "axe-core", "typingsPackageName": "axe-core", "sourceRepoURL": "https://github.com/dequelabs/axe-core", - "asOfVersion": "2.0.7" + "asOfVersion": "3.0.3" }, { "libraryName": "axios", @@ -660,6 +660,12 @@ "sourceRepoURL": "https://github.com/ashtuchkin/iconv-lite", "asOfVersion": "0.4.14" }, + { + "libraryName": "ids", + "typingsPackageName": "ids", + "sourceRepoURL": "https://github.com/bpmn-io/ids", + "asOfVersion": "0.2.2" + }, { "libraryName": "immutability-helper", "typingsPackageName": "immutability-helper", @@ -1002,12 +1008,6 @@ "sourceRepoURL": "https://github.com/blakeembrey/param-case", "asOfVersion": "1.1.2" }, - { - "libraryName": "parse5", - "typingsPackageName": "parse5", - "sourceRepoURL": "https://github.com/inikulin/parse5", - "asOfVersion": "3.0.0" - }, { "libraryName": "pascal-case", "typingsPackageName": "pascal-case", @@ -1152,6 +1152,12 @@ "sourceRepoURL": "https://github.com/react-ga/react-ga", "asOfVersion": "2.3.0" }, + { + "libraryName": "react-monaco-editor", + "typingsPackageName": "react-monaco-editor", + "sourceRepoURL": "https://github.com/superRaytin/react-monaco-editor", + "asOfVersion": "0.16.0" + }, { "libraryName": "react-native-collapsible", "typingsPackageName": "react-native-collapsible", diff --git a/package.json b/package.json index db67595b77..c5b1b03057 100644 --- a/package.json +++ b/package.json @@ -1,27 +1,27 @@ { - "private": true, - "name": "definitely-typed", - "version": "0.0.1", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped", - "repository": { - "type": "git", - "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues" - }, - "engines": { - "node": ">=7.8.0" - }, - "scripts": { - "compile-scripts": "tsc -p scripts", - "not-needed": "node scripts/not-needed.js", - "test": "node node_modules/types-publisher/bin/tester/test.js --run-from-definitely-typed", - "lint": "dtslint types" - }, - "devDependencies": { - "dtslint": "github:Microsoft/dtslint#production", - "types-publisher": "Microsoft/types-publisher#production" - } + "private": true, + "name": "definitely-typed", + "version": "0.0.2", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped", + "repository": { + "type": "git", + "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues" + }, + "engines": { + "node": ">=7.8.0" + }, + "scripts": { + "compile-scripts": "tsc -p scripts", + "not-needed": "node scripts/not-needed.js", + "test": "node node_modules/types-publisher/bin/tester/test.js --run-from-definitely-typed", + "lint": "dtslint types" + }, + "devDependencies": { + "dtslint": "github:Microsoft/dtslint#production", + "types-publisher": "Microsoft/types-publisher#production" + } } diff --git a/types/ace-diff/ace-diff-tests.ts b/types/ace-diff/ace-diff-tests.ts new file mode 100644 index 0000000000..52e64589a3 --- /dev/null +++ b/types/ace-diff/ace-diff-tests.ts @@ -0,0 +1,22 @@ +import AceDiff = require('ace-diff'); + +new AceDiff(); // $ExpectError + +const aceDiffConstructorOpts = { + element: '.acediff', + left: { content: 'left content' }, + right: { content: 'right content' }, +}; +new AceDiff(aceDiffConstructorOpts); // $ExpectType AceDiff + +const differ = new AceDiff(aceDiffConstructorOpts); + +differ.getEditors(); // $ExpectType { left: any; right: any; } +differ.setOptions(); // $ExpectError +const aceDiffOpts = { + diffGranularity: 'broad' as 'broad', // workaround: cast to avoid https://github.com/Microsoft/TypeScript/issues/11465#issuecomment-252453037 +}; +differ.setOptions(aceDiffOpts); // $ExpectType void +differ.getNumDiffs(); // $ExpectType number +differ.diff(); // $ExpectType void +differ.destroy(); // $ExpectType void diff --git a/types/ace-diff/index.d.ts b/types/ace-diff/index.d.ts new file mode 100644 index 0000000000..b59b3d25e2 --- /dev/null +++ b/types/ace-diff/index.d.ts @@ -0,0 +1,52 @@ +// Type definitions for ace-diff 2.1 +// Project: https://ace-diff.github.io/ace-diff/ +// Definitions by: Mike Dodge +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export as namespace AceDiff; + +export = AceDiff; + +declare class AceDiff { + constructor(opts: AceDiff.AceDiffConstructorOpts); + getEditors(): { + left: any; + right: any; + }; + setOptions(options: AceDiff.AceDiffOpts): void; + getNumDiffs(): number; + diff(): void; + destroy(): void; +} +declare namespace AceDiff { + interface AceDiffLROpts { + content?: string | null; + mode?: string; + theme?: string; + editable?: boolean; + copyLinkEnabled?: boolean; + } + + interface AceDiffConstructorOpts extends AceDiffOpts { + element: string | HTMLElement; + left: AceDiffLROpts; + right: AceDiffLROpts; + } + + interface AceDiffOpts { + mode?: string; + theme?: string; + diffGranularity?: 'specific' | 'broad'; + showDiffs?: boolean; + showConnectors?: boolean; + maxDiffs?: number; + left?: AceDiffLROpts; + right?: AceDiffLROpts; + classes?: { + diff: string; + connector: string; + newCodeConnectorLinkContent: string; + deletedCodeConnectorLinkContent: string; + }; + } +} diff --git a/types/ace-diff/tsconfig.json b/types/ace-diff/tsconfig.json new file mode 100644 index 0000000000..00fb70bbcd --- /dev/null +++ b/types/ace-diff/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", + "ace-diff-tests.ts" + ] +} diff --git a/types/react-monaco-editor/tslint.json b/types/ace-diff/tslint.json similarity index 100% rename from types/react-monaco-editor/tslint.json rename to types/ace-diff/tslint.json diff --git a/types/activex-access/activex-access-tests.ts b/types/activex-access/activex-access-tests.ts index f224b92d70..3992ba34fd 100644 --- a/types/activex-access/activex-access-tests.ts +++ b/types/activex-access/activex-access-tests.ts @@ -1,3 +1,5 @@ +/// + let app = new ActiveXObject('Access.Application'); app.UserControl = true; @@ -6,7 +8,7 @@ app.DoCmd.OpenForm('MyForm', Access.AcFormView.acNormal, '', 'LastName="Smith"') // change the contents of a textbox // tslint:disable-next-line:no-unnecessary-type-assertion -let textbox = app.Forms.Item('MyForm').Controls.Item('MyTextBox') as Access.TextBox; +let textbox = app.Forms('MyForm').Controls('MyTextBox') as Access.TextBox; textbox.Text = 'Not Smith'; // save the current record on the active form diff --git a/types/activex-access/index.d.ts b/types/activex-access/index.d.ts index 2529538cad..d0bf798652 100644 --- a/types/activex-access/index.d.ts +++ b/types/activex-access/index.d.ts @@ -4,6 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 +/// /// /// /// @@ -929,6 +930,14 @@ declare namespace Access { acFormReadOnly = 2, } + const enum AcFormSection { + acDetail = 0, + acFooter = 2, + acHeader = 1, + acPageFooter = 4, + acPageHeader = 3, + } + const enum AcFormView { acDesign = 1, acFormDS = 3, @@ -987,6 +996,13 @@ declare namespace Access { acLayoutTabular = 1, } + const enum AcSetMenuItemState { + acMenuCheck = 3, + acMenuGray = 1, + acMenuUncheck = 2, + acMenuUngray = 0, + } + const enum AcModuleType { acClassModule = 1, acStandardModule = 0, @@ -1027,6 +1043,21 @@ declare namespace Access { acReadOnly = 2, } + const enum AcOutputFormat { + acFormatASP = 'Microsoft Active Server Pages (*.asp)', + acFormatDAP = 'Microsoft Access Data Access Page (*.htm; *.html)', + acFormatHTML = 'HTML (*.html)', + acFormatIIS = 'Microsoft IIS (*.htx; *.idc)', + acFormatPDF = 'PDF Format (*.pdf)', + acFormatRTF = 'Rich Text Format (*.rtf)', + acFormatSNP = 'Snapshot Format (*.snp)', + acFormatTXT = 'MS-DOS Text (*.txt)', + acFormatXLS = 'Microsoft Excel (*.xls)', + acFormatXLSB = 'Microsoft Excel Binary Workbook (*.xlsb)', + acFormatXLSX = 'Microsoft Excel Workbook (*.xlsx)', + acFormatXPS = 'XPS Format (*.xps)' + } + const enum AcOutputObjectType { acOutputDataAccessPage = 6, acOutputForm = 2, @@ -1185,18 +1216,7 @@ declare namespace Access { acPrevious = 0, } - const enum AcResourceType { - acResourceImage = 1, - acResourceTheme = 0, - } - - const enum AcSearchDirection { - acDown = 1, - acSearchAll = 2, - acUp = 0, - } - - const enum AcSection { + const enum AcReportSection { acDetail = 0, acFooter = 2, acGroupLevel1Footer = 6, @@ -1208,6 +1228,17 @@ declare namespace Access { acPageHeader = 3, } + const enum AcResourceType { + acResourceImage = 1, + acResourceTheme = 0, + } + + const enum AcSearchDirection { + acDown = 1, + acSearchAll = 2, + acUp = 0, + } + const enum AcSendObjectType { acSendDataAccessPage = 6, acSendForm = 2, @@ -1864,19 +1895,9 @@ declare namespace Access { TypeLib = 0, } - class _AccessProperty { - private 'Access._AccessProperty_typekey': _AccessProperty; - private constructor(); - readonly Application: Application; - readonly Category: number; - readonly Inherited: boolean; - IsMemberSafe(dispid: number): boolean; - Name: string; - readonly Parent: any; - readonly Properties: DAO.Properties; - Type: number; - Value: any; - } + type ByteArray = SafeArray; + + type DatabaseType = 'Microsoft Access (default)' | 'Jet 2.x' | 'Jet 3.x' | 'dBase III' | 'dBase IV' | 'dBase 5.0' | 'Paradox 3.x' | 'Paradox 4.x' | 'Paradox 5.x' | 'Paradox 7.x' | 'ODBC Database' | 'WSS'; class _CheckBoxInOption { private 'Access._CheckBoxInOption_typekey': _CheckBoxInOption; @@ -1957,7 +1978,7 @@ declare namespace Access { Left: number; LeftPadding: number; Locked: boolean; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; OldBorderStyle: number; readonly OldValue: any; @@ -2094,7 +2115,7 @@ declare namespace Access { LeftMargin: number; LeftPadding: number; LineSpacing: number; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; NumeralShapes: number; OldBorderStyle: number; @@ -2161,7 +2182,7 @@ declare namespace Access { readonly Layout: AcLayoutType; readonly LayoutID: number; LeftPadding: number; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; readonly Object: any; ObjectVerbs(Index: number): string; @@ -2249,7 +2270,7 @@ declare namespace Access { LeftPadding: number; Locked: boolean; LpOleObject: number; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; readonly Object: any; ObjectPalette: any; @@ -2290,12 +2311,11 @@ declare namespace Access { Width: number; } - class _ItemsSelected { - private 'Access._ItemsSelected_typekey': _ItemsSelected; - private constructor(); + interface _ItemsSelected { readonly Count: number; IsMemberSafe(dispid: number): boolean; Item(Index: any): number; + (Index: any): number; } class _OptionButtonInOption { @@ -2377,7 +2397,7 @@ declare namespace Access { Left: number; LeftPadding: number; Locked: boolean; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; OldBorderStyle: number; readonly OldValue: any; @@ -2645,7 +2665,7 @@ declare namespace Access { Left: number; LeftPadding: number; Locked: boolean; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; ObjectPalette: any; readonly OldValue: any; @@ -2745,16 +2765,15 @@ declare namespace Access { readonly Type: AcObjectType; } - class AccessObjectProperties { - private 'Access.AccessObjectProperties_typekey': AccessObjectProperties; - private constructor(); + interface AccessObjectProperties { Add(PropertyName: string, Value: any): void; readonly Application: Application; readonly Count: number; IsMemberSafe(dispid: number): boolean; - Item(Index: any): AccessObjectProperty; + Item(Index: number | string): AccessObjectProperty; readonly Parent: any; - Remove(Item: any): void; + Remove(Item: number | string): void; + (Index: number | string): AccessObjectProperty; } class AccessObjectProperty { @@ -2766,130 +2785,42 @@ declare namespace Access { Value: any; } - class AdditionalData { - private 'Access.AdditionalData_typekey': AdditionalData; + interface AccessObjects { + readonly Application: Application; + readonly Count: number; + IsMemberSafe(dispid: number): boolean; + Item(var_0: number | string): AccessObject; + readonly Parent: any; + (var_0: number | string): AccessObject; + } + + class AccessProperty { + private 'Access._AccessProperty_typekey': AccessProperty; private constructor(); + readonly Application: Application; + readonly Category: number; + readonly Inherited: boolean; + IsMemberSafe(dispid: number): boolean; + Name: string; + readonly Parent: any; + readonly Properties: DAO.Properties; + Type: number; + Value: any; + } + + interface AdditionalData { Add(var_0: string): AdditionalData; readonly Count: number; IsMemberSafe(dispid: number): boolean; - Item(Index: any): AdditionalData; + Item(Index: number | string): AdditionalData; Name: string; - } - - class AllDataAccessPages { - private 'Access.AllDataAccessPages_typekey': AllDataAccessPages; - private constructor(); - readonly Application: Application; - readonly Count: number; - IsMemberSafe(dispid: number): boolean; - Item(var_0: any): AccessObject; - readonly Parent: any; - } - - class AllDatabaseDiagrams { - private 'Access.AllDatabaseDiagrams_typekey': AllDatabaseDiagrams; - private constructor(); - readonly Application: Application; - readonly Count: number; - IsMemberSafe(dispid: number): boolean; - Item(var_0: any): AccessObject; - readonly Parent: any; - } - - class AllForms { - private 'Access.AllForms_typekey': AllForms; - private constructor(); - readonly Application: Application; - readonly Count: number; - IsMemberSafe(dispid: number): boolean; - Item(var_0: any): AccessObject; - readonly Parent: any; - } - - class AllFunctions { - private 'Access.AllFunctions_typekey': AllFunctions; - private constructor(); - readonly Application: Application; - readonly Count: number; - IsMemberSafe(dispid: number): boolean; - Item(var_0: any): AccessObject; - readonly Parent: any; - } - - class AllMacros { - private 'Access.AllMacros_typekey': AllMacros; - private constructor(); - readonly Application: Application; - readonly Count: number; - IsMemberSafe(dispid: number): boolean; - Item(var_0: any): AccessObject; - readonly Parent: any; - } - - class AllModules { - private 'Access.AllModules_typekey': AllModules; - private constructor(); - readonly Application: Application; - readonly Count: number; - IsMemberSafe(dispid: number): boolean; - Item(var_0: any): AccessObject; - readonly Parent: any; - } - - class AllQueries { - private 'Access.AllQueries_typekey': AllQueries; - private constructor(); - readonly Application: Application; - readonly Count: number; - IsMemberSafe(dispid: number): boolean; - Item(var_0: any): AccessObject; - readonly Parent: any; - } - - class AllReports { - private 'Access.AllReports_typekey': AllReports; - private constructor(); - readonly Application: Application; - readonly Count: number; - IsMemberSafe(dispid: number): boolean; - Item(var_0: any): AccessObject; - readonly Parent: any; - } - - class AllStoredProcedures { - private 'Access.AllStoredProcedures_typekey': AllStoredProcedures; - private constructor(); - readonly Application: Application; - readonly Count: number; - IsMemberSafe(dispid: number): boolean; - Item(var_0: any): AccessObject; - readonly Parent: any; - } - - class AllTables { - private 'Access.AllTables_typekey': AllTables; - private constructor(); - readonly Application: Application; - readonly Count: number; - IsMemberSafe(dispid: number): boolean; - Item(var_0: any): AccessObject; - readonly Parent: any; - } - - class AllViews { - private 'Access.AllViews_typekey': AllViews; - private constructor(); - readonly Application: Application; - readonly Count: number; - IsMemberSafe(dispid: number): boolean; - Item(var_0: any): AccessObject; - readonly Parent: any; + (Index: number | string): AdditionalData; } class Application { private 'Access.Application_typekey': Application; private constructor(); - AccessError(ErrorNumber: any): any; + AccessError(ErrorNumber: number): string; AddAutoCorrect(ChangeFrom: string, ChangeTo: string): void; AddToFavorites(): void; readonly ADOConnectString: string; @@ -2914,46 +2845,42 @@ declare namespace Access { readonly COMAddIns: Office.COMAddIns; readonly CommandBars: Office.CommandBars; - /** @param boolean [LogFile=false] */ + /** @param LogFile [LogFile=false] */ CompactRepair(SourceFile: string, DestinationFile: string, LogFile?: boolean): boolean; ConvertAccessProject(SourceFilename: string, DestinationFilename: string, DestinationFileFormat: AcFileFormat): void; - CreateAccessProject(filepath: string, Connect?: any): void; + CreateAccessProject(filepath: string, Connect?: string): void; CreateAdditionalData(): AdditionalData; - /** @param Access.AcSection [Section=0] */ - CreateControl(FormName: string, ControlType: AcControlType, Section?: AcSection, Parent?: any, ColumnName?: any, Left?: any, Top?: any, Width?: any, Height?: any): Control; - CreateControlEx( - FormName: string, ControlType: AcControlType, Section: AcSection, Parent: string, ControlSource: string, Left: number, Top: number, Width: number, Height: number): Control; - CreateControlExOld( - FormName: string, ControlType: AcControlType, Section: AcSection, Parent: string, ControlSource: string, Left: number, Top: number, Width: number, Height: number): Control; + /** @param Section [Section=0] */ + CreateControl(FormName: string, ControlType: AcControlType, Section?: AcFormSection, Parent?: string, ColumnName?: string, Left?: number, Top?: number, Width?: number, Height?: number): Control; + CreateControlEx(FormName: string, ControlType: AcControlType, Section: AcFormSection, Parent: string, ControlSource: string, Left: number, Top: number, Width: number, Height: number): Control; + CreateControlExOld(FormName: string, ControlType: AcControlType, Section: AcFormSection, Parent: string, ControlSource: string, Left: number, Top: number, Width: number, Height: number): Control; - /** @param Access.AcSection [Section=0] */ - CreateControlOld(FormName: string, ControlType: AcControlType, Section?: AcSection, Parent?: any, ColumnName?: any, Left?: any, Top?: any, Width?: any, Height?: any): Control; + /** @param Section [Section=0] */ + CreateControlOld(FormName: string, ControlType: AcControlType, Section?: AcFormSection, Parent?: string, ColumnName?: string, Left?: number, Top?: number, Width?: number, Height?: number): Control; - /** @param boolean [CreateNewFile=true] */ - CreateDataAccessPage(FileName: any, CreateNewFile?: boolean): DataAccessPage; - CreateForm(Database?: any, FormTemplate?: any): Form; + /** @param CreateNewFile [CreateNewFile=true] */ + CreateDataAccessPage(FileName: string, CreateNewFile?: boolean): DataAccessPage; + CreateForm(Database?: string, FormTemplate?: string): Form; CreateGroupLevel(ReportName: string, Expression: string, Header: number, Footer: number): number; /** - * @param string [Path=' '] - * @param string [Name=' '] - * @param string [Company=' '] - * @param string [WorkgroupID=' '] - * @param boolean [Replace=false] + * @param Path [Path=' '] + * @param Name [Name=' '] + * @param Company [Company=' '] + * @param WorkgroupID [WorkgroupID=' '] + * @param Replace [Replace=false] */ CreateNewWorkgroupFile(Path?: string, Name?: string, Company?: string, WorkgroupID?: string, Replace?: boolean): void; - CreateReport(Database?: any, ReportTemplate?: any): Report; + CreateReport(Database?: string, ReportTemplate?: string): Report; - /** @param Access.AcSection [Section=0] */ - CreateReportControl(ReportName: string, ControlType: AcControlType, Section?: AcSection, Parent?: any, ColumnName?: any, Left?: any, Top?: any, Width?: any, Height?: any): Control; - CreateReportControlEx( - ReportName: string, ControlType: AcControlType, Section: AcSection, Parent: string, ControlName: string, Left: number, Top: number, Width: number, Height: number): Control; - CreateReportControlExOld( - ReportName: string, ControlType: AcControlType, Section: AcSection, Parent: string, ControlName: string, Left: number, Top: number, Width: number, Height: number): Control; + /** @param Section [Section=0] */ + CreateReportControl(ReportName: string, ControlType: AcControlType, Section?: AcReportSection, Parent?: string, ColumnName?: string, Left?: number, Top?: number, Width?: number, Height?: number): Control; + CreateReportControlEx(ReportName: string, ControlType: AcControlType, Section: AcReportSection, Parent: string, ControlName: string, Left: number, Top: number, Width: number, Height: number): Control; + CreateReportControlExOld(ReportName: string, ControlType: AcControlType, Section: AcReportSection, Parent: string, ControlName: string, Left: number, Top: number, Width: number, Height: number): Control; - /** @param Access.AcSection [Section=0] */ - CreateReportControlOld(ReportName: string, ControlType: AcControlType, Section?: AcSection, Parent?: any, ColumnName?: any, Left?: any, Top?: any, Width?: any, Height?: any): Control; + /** @param Section [Section=0] */ + CreateReportControlOld(ReportName: string, ControlType: AcControlType, Section?: AcReportSection, Parent?: string, ColumnName?: string, Left?: number, Top?: number, Width?: number, Height?: number): Control; readonly CurrentData: CurrentData; CurrentDb(): DAO.Database; readonly CurrentObjectName: string; @@ -2963,97 +2890,99 @@ declare namespace Access { CurrentWebUser(DisplayOption: AcWebUserDisplay): any; CurrentWebUserGroups(DisplayOption: AcWebUserGroupsDisplay): any; readonly DataAccessPages: DataAccessPages; - DAvg(Expr: string, Domain: string, Criteria?: any): any; + DAvg(Expr: string, Domain: string, Criteria?: string): number | null; readonly DBEngine: DAO.DBEngine; - DCount(Expr: string, Domain: string, Criteria?: any): any; - DDEExecute(ChanNum: any, Command: string): void; - DDEInitiate(Application: string, Topic: string): any; - DDEPoke(ChanNum: any, Item: string, Data: string): void; - DDERequest(ChanNum: any, Item: string): string; - DDETerminate(ChanNum: any): void; + DCount(Expr: string, Domain: string, Criteria?: string): number | null; + DDEExecute(ChanNum: number, Command: string): void; + DDEInitiate(Application: string, Topic: string): number; + DDEPoke(ChanNum: number, Item: string, Data: string): void; + DDERequest(ChanNum: number, Item: string): string; + DDETerminate(ChanNum: number): void; DDETerminateAll(): void; readonly DefaultWebOptions: DefaultWebOptions; DefaultWorkspaceClone(): DAO.Workspace; DelAutoCorrect(ChangeFrom: string): void; DeleteControl(FormName: string, ControlName: string): void; DeleteReportControl(ReportName: string, ControlName: string): void; - DFirst(Expr: string, Domain: string, Criteria?: any): any; + DFirst(Expr: string, Domain: string, Criteria?: string): any; DirtyObject(ObjectType: AcObjectType, ObjectName: string): void; - DLast(Expr: string, Domain: string, Criteria?: any): any; - DLookup(Expr: string, Domain: string, Criteria?: any): any; - DMax(Expr: string, Domain: string, Criteria?: any): any; - DMin(Expr: string, Domain: string, Criteria?: any): any; + DLast(Expr: string, Domain: string, Criteria?: string): any; + DLookup(Expr: string, Domain: string, Criteria?: string): any; + DMax(Expr: string, Domain: string, Criteria?: string): any; + DMin(Expr: string, Domain: string, Criteria?: string): any; readonly DoCmd: DoCmd; - DStDev(Expr: string, Domain: string, Criteria?: any): any; - DStDevP(Expr: string, Domain: string, Criteria?: any): any; - DSum(Expr: string, Domain: string, Criteria?: any): any; - DVar(Expr: string, Domain: string, Criteria?: any): any; - DVarP(Expr: string, Domain: string, Criteria?: any): any; + DStDev(Expr: string, Domain: string, Criteria?: string): number | null; + DStDevP(Expr: string, Domain: string, Criteria?: string): number | null; + DSum(Expr: string, Domain: string, Criteria?: string): number | null; + DVar(Expr: string, Domain: string, Criteria?: string): number | null; + DVarP(Expr: string, Domain: string, Criteria?: string): number | null; - /** @param string [bstrStatusBarText=''] */ + /** @param bstrStatusBarText [bstrStatusBarText=''] */ Echo(EchoOn: number, bstrStatusBarText?: string): void; - EuroConvert(Number: number, SourceCurrency: string, TargetCurrency: string, FullPrecision?: any, TriangulationPrecision?: any): number; + EuroConvert(Number: number, SourceCurrency: string, TargetCurrency: string, FullPrecision?: boolean, TriangulationPrecision?: number): number; Eval(StringExpr: string): any; /** - * @param boolean [SelectedRecords=false] - * @param number [FromPage=1] - * @param number [ToPage=-1] + * @param SelectedRecords [SelectedRecords=false] + * @param FromPage [FromPage=1] + * @param ToPage [ToPage=-1] */ - ExportCustomFixedFormat( - ExternalExporter: any, OutputFileName: string, ObjectName: string, ObjectType: AcOutputObjectType, SelectedRecords?: boolean, FromPage?: number, ToPage?: number): void; + ExportCustomFixedFormat(ExternalExporter: any, OutputFileName: string, ObjectName: string, ObjectType: AcOutputObjectType, SelectedRecords?: boolean, FromPage?: number, ToPage?: number): void; ExportNavigationPane(Path: string): void; /** - * @param string [DataTarget=''] - * @param string [SchemaTarget=''] - * @param string [PresentationTarget=''] - * @param string [ImageTarget=''] - * @param Access.AcExportXMLEncoding [Encoding=0] - * @param Access.AcExportXMLOtherFlags [OtherFlags=0] - * @param string [WhereCondition=''] + * @param DataTarget [DataTarget=''] + * @param SchemaTarget [SchemaTarget=''] + * @param PresentationTarget [PresentationTarget=''] + * @param ImageTarget [ImageTarget=''] + * @param Encoding [Encoding=0] + * @param OtherFlags [OtherFlags=0] + * @param WhereCondition [WhereCondition=''] */ - ExportXML( - ObjectType: AcExportXMLObjectType, DataSource: string, DataTarget?: string, SchemaTarget?: string, PresentationTarget?: string, ImageTarget?: string, - Encoding?: AcExportXMLEncoding, OtherFlags?: AcExportXMLOtherFlags, WhereCondition?: string, AdditionalData?: any): void; + ExportXML(ObjectType: AcExportXMLObjectType, DataSource: string, DataTarget?: string, SchemaTarget?: string, PresentationTarget?: string, ImageTarget?: string, Encoding?: AcExportXMLEncoding, OtherFlags?: AcExportXMLOtherFlags, WhereCondition?: string, AdditionalData?: AdditionalData): void; /** - * @param string [DataTarget=''] - * @param string [SchemaTarget=''] - * @param string [PresentationTarget=''] - * @param string [ImageTarget=''] - * @param Access.AcExportXMLEncoding [Encoding=0] - * @param number [OtherFlags=0] + * @param DataTarget [DataTarget=''] + * @param SchemaTarget [SchemaTarget=''] + * @param PresentationTarget [PresentationTarget=''] + * @param ImageTarget [ImageTarget=''] + * @param Encoding [Encoding=0] + * @param OtherFlags [OtherFlags=0] */ - ExportXMLOld( - ObjectType: AcExportXMLObjectType, DataSource: string, DataTarget?: string, SchemaTarget?: string, PresentationTarget?: string, ImageTarget?: string, - Encoding?: AcExportXMLEncoding, OtherFlags?: number): void; + ExportXMLOld(ObjectType: AcExportXMLObjectType, DataSource: string, DataTarget?: string, SchemaTarget?: string, PresentationTarget?: string, ImageTarget?: string, Encoding?: AcExportXMLEncoding, OtherFlags?: number): void; FeatureInstall: Office.MsoFeatureInstall; FileDialog(dialogType: Office.MsoFileDialogType): Office.FileDialog; readonly FileSearch: Office.FileSearch; /** - * @param string [SubAddress=''] - * @param boolean [NewWindow=false] - * @param boolean [AddHistory=true] - * @param Office.MsoExtraInfoMethod [Method=0] - * @param string [HeaderInfo=''] + * @param SubAddress [SubAddress=''] + * @param NewWindow [NewWindow=false] + * @param AddHistory [AddHistory=true] + * @param Method [Method=0] + * @param HeaderInfo [HeaderInfo=''] */ - FollowHyperlink(Address: string, SubAddress?: string, NewWindow?: boolean, AddHistory?: boolean, ExtraInfo?: any, Method?: Office.MsoExtraInfoMethod, HeaderInfo?: string): void; + FollowHyperlink(Address: string, SubAddress?: string, NewWindow?: boolean, AddHistory?: boolean, ExtraInfo?: string | ByteArray, Method?: Office.MsoExtraInfoMethod, HeaderInfo?: string): void; readonly Forms: Forms; GetHiddenAttribute(ObjectType: AcObjectType, ObjectName: string): boolean; - GetOption(OptionName: string): any; - GUIDFromString(String: any): any; - HtmlEncode(PlainText: any, Length?: any): string; + + /** + * Returns different types of values based on how the options are set: + * * If by selecting / clearing a checkbox, returns `boolean` + * * If by typing a string or numeric value, returns `string` or `number` + * * If by choosing from a list, will return the 0-based index of the selected item + */ + GetOption(OptionName: string): boolean | string | number; + GUIDFromString(String: string): ByteArray; + HtmlEncode(PlainText: string, Length?: number): string; hWndAccessApp(): number; - /** @param Access.AcHyperlinkPart [Part=0] */ + /** @param Part [Part=0] */ HyperlinkPart(Hyperlink: any, Part?: AcHyperlinkPart): string; - /** @param boolean [fAppendOnly=false] */ + /** @param fAppendOnly [fAppendOnly=false] */ ImportNavigationPane(Path: string, fAppendOnly?: boolean): void; - /** @param Access.AcImportXMLOption [ImportOptions=1] */ + /** @param ImportOptions [ImportOptions=1] */ ImportXML(DataSource: string, ImportOptions?: AcImportXMLOption): void; InsertText(Text: string, ModuleName: string): void; InstantiateTemplate(Path: string): void; @@ -3072,36 +3001,36 @@ declare namespace Access { readonly Modules: Modules; readonly MsoDebugOptions: Office.MsoDebugOptions; readonly Name: string; - NewAccessProject(filepath: string, Connect?: any): void; + NewAccessProject(filepath: string, Connect?: string): void; /** - * @param Access.AcNewDatabaseFormat [FileFormat=0] - * @param string [SiteAddress=''] - * @param string [ListID=''] + * @param FileFormat [FileFormat=0] + * @param SiteAddress [SiteAddress=''] + * @param ListID [ListID=''] */ - NewCurrentDatabase(filepath: string, FileFormat?: AcNewDatabaseFormat, Template?: any, SiteAddress?: string, ListID?: string): void; + NewCurrentDatabase(filepath: string, FileFormat?: AcNewDatabaseFormat, Template?: string, SiteAddress?: string, ListID?: string): void; NewCurrentDatabaseOld(filepath: string): void; readonly NewFileTaskPane: Office.NewFile; Nz(Value: any, ValueIfNull?: any): any; - /** @param boolean [Exclusive=false] */ + /** @param Exclusive [Exclusive=false] */ OpenAccessProject(filepath: string, Exclusive?: boolean): void; /** - * @param boolean [Exclusive=false] - * @param string [bstrPassword=''] + * @param Exclusive [Exclusive=false] + * @param bstrPassword [bstrPassword=''] */ OpenCurrentDatabase(filepath: string, Exclusive?: boolean, bstrPassword?: string): void; - /** @param boolean [Exclusive=false] */ + /** @param Exclusive [Exclusive=false] */ OpenCurrentDatabaseOld(filepath: string, Exclusive?: boolean): void; readonly Parent: any; - PlainText(RichText: any, Length?: any): string; + PlainText(RichText: string, Length?: number): string; Printer: Printer; readonly Printers: Printers; readonly ProductCode: string; - /** @param Access.AcQuitOption [Option=1] */ + /** @param Option [Option=1] */ Quit(Option?: AcQuitOption): void; readonly References: References; RefreshDatabaseWindow(): void; @@ -3110,29 +3039,35 @@ declare namespace Access { ReplaceModule(objtyp: number, ModuleName: string, FileName: string, token: number): void; readonly Reports: Reports; readonly ReturnVars: ReturnVars; - Run( - Procedure: string, 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(Procedure: string, 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; RunCommand(Command: AcCommand): void; SaveAsAXL(ObjectType: AcObjectType, ObjectName: string, FileName: string): void; - SaveAsTemplate( - Path: string, Title: string, IconPath: string, CoreTable: string, Category: string, PreviewPath?: any, Description?: any, InstantiationForm?: any, - ApplicationPart?: any, IncludeData?: any, Variation?: any): void; + SaveAsTemplate(Path: string, Title: string, IconPath: string, CoreTable: string, Category: string, PreviewPath?: any, Description?: string, InstantiationForm?: string, ApplicationPart?: boolean, IncludeData?: boolean, Variation?: any): void; SaveAsText(ObjectType: AcObjectType, ObjectName: string, FileName: string): void; readonly Screen: Screen; SetDefaultWorkgroupFile(Path: string): void; SetHiddenAttribute(ObjectType: AcObjectType, ObjectName: string, fHidden: boolean): void; - SetOption(OptionName: string, Setting: any): void; + + /** + * Pass different types of values based on how the option is set in the UI + * * If by selecting / clearing a checkbox, pass a `boolean` + * * If by typing a string or numeric value, pass a `string` or `number` + * * If by choosing from a list, pass the 0-based index of the tiem to select + */ + SetOption(OptionName: string, Setting: boolean | string | number): void; SetUndoRecording(yesno: number): void; ShortcutMenuBar: string; - StringFromGUID(Guid: any): any; - SysCmd(Action: AcSysCmdAction, Argument2?: any, Argument3?: any): any; + StringFromGUID(Guid: ByteArray): string; + SysCmd(Action: AcSysCmdAction.acSysCmdInitMeter, StatusText: string, MaxValue: number): null; + SysCmd(Action: AcSysCmdAction.acSysCmdUpdateMeter, CurrentValue: number): null; + SysCmd(Action: AcSysCmdAction.acSysCmdSetStatus, StatusText: string): null; + SysCmd(Action: AcSysCmdAction.acSysCmdGetObjectState, Argument2: AcObjectType, Argument3: string): Constants.acObjStateDirty | Constants.acObjStateNew | Constants.acObjStateOpen; + SysCmd(Acton: AcSysCmdAction.acSysCmdAccessDir | AcSysCmdAction.acSysCmdAccessVer | AcSysCmdAction.acSysCmdClearHelpTopic | AcSysCmdAction.acSysCmdClearStatus | AcSysCmdAction.acSysCmdGetWorkgroupFile | AcSysCmdAction.acSysCmdIniFile | AcSysCmdAction.acSysCmdProfile | AcSysCmdAction.acSysCmdRemoveMeter | AcSysCmdAction.acSysCmdRuntime): null; readonly TempVars: TempVars; /** - * @param boolean [WellFormedXMLOutput=false] - * @param Access.AcTransformXMLScriptOption [ScriptOption=1] + * @param WellFormedXMLOutput [WellFormedXMLOutput=false] + * @param ScriptOption [ScriptOption=1] */ TransformXML(DataSource: string, TransformSource: string, OutputTarget: string, WellFormedXMLOutput?: boolean, ScriptOption?: AcTransformXMLScriptOption): void; UserControl: boolean; @@ -3206,9 +3141,9 @@ declare namespace Access { Enabled: boolean; EventProcPrefix: string; FileData(var_0?: any): any; - FileName(var_0?: any): string; - FileType(var_0?: any): string; - FileURL(var_0?: any): string; + FileName(var_0?: number | string): string; + FileType(var_0?: number | string): string; + FileURL(var_0?: number | string): string; Forward(): void; Goto(): void; GridlineColor: number; @@ -3238,7 +3173,7 @@ declare namespace Access { Left: number; LeftPadding: number; Locked: boolean; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: null): void; Name: string; OldBorderStyle: number; readonly OldValue: any; @@ -3390,7 +3325,7 @@ declare namespace Access { LeftPadding: number; Locked: boolean; LpOleObject: number; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; readonly Object: any; ObjectPalette: any; @@ -3533,7 +3468,7 @@ declare namespace Access { Left: number; LeftPadding: number; Locked: boolean; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; OldBorderStyle: number; readonly OldValue: any; @@ -3588,12 +3523,13 @@ declare namespace Access { Width: number; } - class Children { - private 'Access.Children_typekey': Children; - private constructor(); + interface Children { readonly Count: number; IsMemberSafe(dispid: number): boolean; - Item(Index: any): any; + // tslint:disable-next-line:no-unnecessary-generics + Item(Index: number | string): T; + // tslint:disable-next-line:no-unnecessary-generics + (Index: number | string): T; } class Class { @@ -3604,12 +3540,12 @@ declare namespace Access { class CodeData { private 'Access.CodeData_typekey': CodeData; private constructor(); - readonly AllDatabaseDiagrams: AllDatabaseDiagrams; - readonly AllFunctions: AllFunctions; - readonly AllQueries: AllQueries; - readonly AllStoredProcedures: AllStoredProcedures; - readonly AllTables: AllTables; - readonly AllViews: AllViews; + readonly AllDatabaseDiagrams: AccessObjects; + readonly AllFunctions: AccessObjects; + readonly AllQueries: AccessObjects; + readonly AllStoredProcedures: AccessObjects; + readonly AllTables: AccessObjects; + readonly AllViews: AccessObjects; IsMemberSafe(dispid: number): boolean; } @@ -3618,11 +3554,11 @@ declare namespace Access { private constructor(); readonly AccessConnection: ADODB.Connection; AddSharedImage(SharedImageName: string, FileName: string): void; - readonly AllDataAccessPages: AllDataAccessPages; - readonly AllForms: AllForms; - readonly AllMacros: AllMacros; - readonly AllModules: AllModules; - readonly AllReports: AllReports; + readonly AllDataAccessPages: AccessObjects; + readonly AllForms: AccessObjects; + readonly AllMacros: AccessObjects; + readonly AllModules: AccessObjects; + readonly AllReports: AccessObjects; readonly Application: Application; readonly BaseConnectionString: string; CloseConnection(): void; @@ -3635,7 +3571,7 @@ declare namespace Access { readonly IsTrusted: boolean; readonly IsWeb: boolean; readonly Name: string; - OpenConnection(BaseConnectionString?: any, UserID?: any, Password?: any): void; + OpenConnection(BaseConnectionString?: string, UserID?: string, Password?: string): void; readonly Parent: any; readonly Path: string; readonly ProjectType: AcProjectType; @@ -3671,7 +3607,7 @@ declare namespace Access { accState(varChild?: any): any; accValue(varChild?: any): string; AddColon: boolean; - AddItem(Item: string, Index?: any): void; + AddItem(Item: string, Index?: number): void; AfterUpdate: string; AfterUpdateMacro: string; AllowAutoCorrect: boolean; @@ -3700,7 +3636,7 @@ declare namespace Access { CanGrow: boolean; CanShrink: boolean; Coltyp: number; - Column(Index: number, Row?: any): any; + Column(Index: number, Row?: number): any; ColumnCount: number; ColumnHeads: boolean; ColumnHidden: boolean; @@ -3777,7 +3713,7 @@ declare namespace Access { ListRows: number; ListWidth: string; Locked: boolean; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; NumeralShapes: number; OldBorderStyle: number; @@ -3815,8 +3751,8 @@ declare namespace Access { readonly Parent: any; readonly Properties: Properties; ReadingOrder: number; - Recordset: any; - RemoveItem(Index: any): void; + Recordset: DAO.Recordset | ADODB.Recordset; + RemoveItem(Index: number | string): void; Requery(): void; RightMargin: number; RightPadding: number; @@ -3961,7 +3897,7 @@ declare namespace Access { readonly LayoutID: number; Left: number; LeftPadding: number; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; ObjectPalette: any; readonly OldValue: any; @@ -4039,7 +3975,7 @@ declare namespace Access { _Name: string; readonly Application: Application; BottomPadding: number; - Column(Index: number, Row?: any): any; + Column(Index: number, Row?: number): any; readonly Controls: Children; Dropdown(): void; readonly Form: Form; @@ -4061,7 +3997,7 @@ declare namespace Access { readonly Layout: AcLayoutType; readonly LayoutID: number; LeftPadding: number; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; readonly Object: any; ObjectVerbs(Index: number): string; @@ -4081,27 +4017,26 @@ declare namespace Access { VerticalAnchor: AcVerticalAnchor; } - class Controls { - private 'Access.Controls_typekey': Controls; - private constructor(); + interface Controls { readonly Application: Application; readonly Count: number; IsMemberSafe(dispid: number): boolean; // tslint:disable-next-line:no-unnecessary-generics - Item(index: number | string): T; - Item(Index: number | string): Control; + Item(Index: number | string): T; readonly Parent: any; + // tslint:disable-next-line:no-unnecessary-generics + (Index: number | string): T; } class CurrentData { private 'Access.CurrentData_typekey': CurrentData; private constructor(); - readonly AllDatabaseDiagrams: AllDatabaseDiagrams; - readonly AllFunctions: AllFunctions; - readonly AllQueries: AllQueries; - readonly AllStoredProcedures: AllStoredProcedures; - readonly AllTables: AllTables; - readonly AllViews: AllViews; + readonly AllDatabaseDiagrams: AccessObjects; + readonly AllFunctions: AccessObjects; + readonly AllQueries: AccessObjects; + readonly AllStoredProcedures: AccessObjects; + readonly AllTables: AccessObjects; + readonly AllViews: AccessObjects; IsMemberSafe(dispid: number): boolean; } @@ -4110,11 +4045,11 @@ declare namespace Access { private constructor(); readonly AccessConnection: ADODB.Connection; AddSharedImage(SharedImageName: string, FileName: string): void; - readonly AllDataAccessPages: AllDataAccessPages; - readonly AllForms: AllForms; - readonly AllMacros: AllMacros; - readonly AllModules: AllModules; - readonly AllReports: AllReports; + readonly AllDataAccessPages: AccessObjects; + readonly AllForms: AccessObjects; + readonly AllMacros: AccessObjects; + readonly AllModules: AccessObjects; + readonly AllReports: AccessObjects; readonly Application: Application; readonly BaseConnectionString: string; CloseConnection(): void; @@ -4127,7 +4062,7 @@ declare namespace Access { readonly IsTrusted: boolean; readonly IsWeb: boolean; readonly Name: string; - OpenConnection(BaseConnectionString?: any, UserID?: any, Password?: any): void; + OpenConnection(BaseConnectionString?: string, UserID?: string, Password?: string): void; readonly Parent: any; readonly Path: string; readonly ProjectType: AcProjectType; @@ -4206,7 +4141,7 @@ declare namespace Access { LeftPadding: number; Locked: boolean; LpOleObject: number; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; readonly Object: any; ObjectPalette: any; @@ -4271,14 +4206,13 @@ declare namespace Access { readonly WindowWidth: number; } - class DataAccessPages { - private 'Access.DataAccessPages_typekey': DataAccessPages; - private constructor(); + interface DataAccessPages { readonly Application: Application; readonly Count: number; IsMemberSafe(dispid: number): boolean; Item(var_0: any): DataAccessPage; readonly Parent: any; + (var_0: any): DataAccessPage; } class DefaultWebOptions { @@ -4313,192 +4247,231 @@ declare namespace Access { readonly UnsupportedObjects: DependencyObjects; } - class DependencyObjects { - private 'Access.DependencyObjects_typekey': DependencyObjects; - private constructor(); + interface DependencyObjects { readonly Application: Application; readonly Count: number; IsMemberSafe(dispid: number): boolean; - Item(Index: any): AccessObject; + Item(Index: number | string): AccessObject; readonly Parent: any; + (Index: number | string): AccessObject; } class DoCmd { private 'Access.DoCmd_typekey': DoCmd; private constructor(); - AddMenu(MenuName: any, MenuMacroName: any, StatusBarText?: any): void; - ApplyFilter(FilterName?: any, WhereCondition?: any, ControlName?: any): void; - ApplyFilterOld0(FilterName?: any, WhereCondition?: any): void; + AddMenu(MenuName: string, MenuMacroName: string, StatusBarText?: string): void; + ApplyFilter(FilterName?: string, WhereCondition?: string, ControlName?: any): void; + ApplyFilterOld0(FilterName?: string, WhereCondition?: string): void; Beep(): void; - /** @param Access.AcFormOpenDataMode [DataMode=1] */ - BrowseTo(ObjectType: AcBrowseToObjectType, ObjectName: any, PathtoSubformControl: any, WhereCondition: any, Page: any, DataMode?: AcFormOpenDataMode): void; + /** @param DataMode [DataMode=1] */ + BrowseTo(ObjectType: AcBrowseToObjectType, ObjectName: string, PathtoSubformControl?: string, WhereCondition?: string, Page?: string, DataMode?: AcFormOpenDataMode): void; CancelEvent(): void; ClearMacroError(): void; /** - * @param Access.AcObjectType [ObjectType=-1] - * @param Access.AcCloseSave [Save=0] + * @param ObjectType [ObjectType=-1] + * @param Save [Save=0] */ - Close(ObjectType: AcObjectType, ObjectName: any, Save?: AcCloseSave): void; + Close(ObjectType: AcObjectType, ObjectName: string, Save?: AcCloseSave): void; Close(): void; CloseDatabase(): void; - CopyDatabaseFile(DatabaseFileName: any, OverwriteExistingFile?: any, DisconnectAllUsers?: any): void; + CopyDatabaseFile(DatabaseFileName: string, OverwriteExistingFile?: boolean, DisconnectAllUsers?: boolean): void; - /** @param Access.AcObjectType [SourceObjectType=-1] */ - CopyObject(DestinationDatabase: any, NewName: any, SourceObjectType?: AcObjectType, SourceObjectName?: any): void; + /** @param SourceObjectType [SourceObjectType=-1] */ + CopyObject(DestinationDatabase: string, NewName: string, SourceObjectType?: AcObjectType, SourceObjectName?: string): void; - /** @param Access.AcObjectType [ObjectType=-1] */ - DeleteObject(ObjectType?: AcObjectType, ObjectName?: any): void; - DoMenuItem(MenuBar: any, MenuName: any, Command: any, Subcommand?: any, Version?: any): void; - Echo(EchoOn: any, StatusBarText?: any): void; + /** @param ObjectType [ObjectType=-1] */ + DeleteObject(ObjectType?: AcObjectType, ObjectName?: string): void; + + /** @deprecated Use the **RunCommand** method */ + DoMenuItem(MenuBar: Constants.acFormBar | number, MenuName: Constants.acFile | Constants.acEditMenu | Constants.acRecordsMenu | number, Command: Constants.acNew | Constants.acSaveForm | Constants.acSaveFormAs | Constants.acSaveRecord | Constants.acUndo | Constants.acCut | Constants.acCopy | Constants.acPaste | Constants.acDelete | Constants.acSelectRecord | Constants.acSelectAllRecords | Constants.acRefresh | number, Subcommand?: Constants.acObjectVerb | Constants.acObjectUpdate | number, Version?: Constants.acMenuVer70 | Constants.acMenuVer20 | Constants.acMenuVer1X): void; + Echo(EchoOn: boolean, StatusBarText?: string): void; FindNext(): void; /** - * @param Access.AcFindMatch [Match=1] - * @param Access.AcSearchDirection [Search=2] - * @param Access.AcFindField [OnlyCurrentField=-1] + * @param Match [Match=1] + * @param MatchCase [MatchCase=false] + * @param Search [Search=2] + * @param SearchAsFormatted [SearchAsFormatted=false] + * @param OnlyCurrentField [OnlyCurrentField=-1] */ - FindRecord(FindWhat: any, Match?: AcFindMatch, MatchCase?: any, Search?: AcSearchDirection, SearchAsFormatted?: any, OnlyCurrentField?: AcFindField, FindFirst?: any): void; - GoToControl(ControlName: any): void; - GoToPage(PageNumber: any, Right?: any, Down?: any): void; + FindRecord(FindWhat: string | number | VarDate, Match?: AcFindMatch, MatchCase?: boolean, Search?: AcSearchDirection, SearchAsFormatted?: boolean, OnlyCurrentField?: AcFindField, FindFirst?: boolean): void; + GoToControl(ControlName: string): void; + GoToPage(PageNumber: number, Right?: number, Down?: number): void; /** - * @param Access.AcDataObjectType [ObjectType=-1] - * @param Access.AcRecord [Record=1] + * @param ObjectType [ObjectType=-1] + * @param Record [Record=1] */ - GoToRecord(ObjectType?: AcDataObjectType, ObjectName?: any, Record?: AcRecord, Offset?: any): void; - Hourglass(HourglassOn: any): void; - LockNavigationPane(Lock: any): void; + GoToRecord(ObjectType?: AcDataObjectType, ObjectName?: string, Record?: AcRecord.acFirst | AcRecord.acLast | AcRecord.acNewRec): void; + + /** + * @param ObjectType [ObjectType=-1] + * @param Record [Record=1] + */ + GoToRecord(ObjectType?: AcDataObjectType, ObjectName?: string, Record?: AcRecord, Offset?: AcRecord.acNext | AcRecord.acPrevious | AcRecord.acGoTo): void; + Hourglass(HourglassOn: boolean): void; + LockNavigationPane(Lock: boolean): void; Maximize(): void; Minimize(): void; - MoveSize(Right?: any, Down?: any, Width?: any, Height?: any): void; + MoveSize(Right?: number, Down?: number, Width?: number, Height?: number): void; NavigateTo(Category?: any, Group?: any): void; - /** @param Access.AcDataAccessPageView [View=0] */ - OpenDataAccessPage(DataAccessPageName: any, View?: AcDataAccessPageView): void; - OpenDiagram(DiagramName: any): void; + /** @param View [View=0] */ + OpenDataAccessPage(DataAccessPageName: string, View?: AcDataAccessPageView): void; + OpenDiagram(DiagramName: string): void; /** - * @param Access.AcFormView [View=0] - * @param Access.AcFormOpenDataMode [DataMode=-1] - * @param Access.AcWindowMode [WindowMode=0] + * @param View [View=0] + * @param DataMode [DataMode=-1] + * @param WindowMode [WindowMode=0] */ - OpenForm(FormName: any, View?: AcFormView, FilterName?: string, WhereCondition?: string, DataMode?: AcFormOpenDataMode, WindowMode?: AcWindowMode, OpenArgs?: string): void; + OpenForm(FormName: string, View?: AcFormView, FilterName?: string, WhereCondition?: string, DataMode?: AcFormOpenDataMode, WindowMode?: AcWindowMode, OpenArgs?: string): void; /** - * @param Access.AcView [View=0] - * @param Access.AcOpenDataMode [DataMode=1] + * @param View [View=0] + * @param DataMode [DataMode=1] */ - OpenFunction(FunctionName: any, View?: AcView, DataMode?: AcOpenDataMode): void; - OpenModule(ModuleName?: any, ProcedureName?: any): void; + OpenFunction(FunctionName: string, View?: AcView, DataMode?: AcOpenDataMode): void; + OpenModule(ModuleName?: string, ProcedureName?: string): void; /** - * @param Access.AcView [View=0] - * @param Access.AcOpenDataMode [DataMode=1] + * @param View [View=0] + * @param DataMode [DataMode=1] */ - OpenQuery(QueryName: any, View?: AcView, DataMode?: AcOpenDataMode): void; + OpenQuery(QueryName: string, View?: AcView, DataMode?: AcOpenDataMode): void; /** - * @param Access.AcView [View=0] - * @param Access.AcWindowMode [WindowMode=0] + * @param View [View=0] + * @param WindowMode [WindowMode=0] */ - OpenReport(ReportName: any, View?: AcView, FilterName?: string, WhereCondition?: string, WindowMode?: AcWindowMode, OpenArgs?: string): void; + OpenReport(ReportName: string, View?: AcView, FilterName?: string, WhereCondition?: string, WindowMode?: AcWindowMode, OpenArgs?: string): void; - /** @param Access.AcView [View=0] */ + /** @param View [View=0] */ OpenReportOld0(ReportName: any, View?: AcView, FilterName?: any, WhereCondition?: any): void; /** - * @param Access.AcView [View=0] - * @param Access.AcOpenDataMode [DataMode=1] + * @param View [View=0] + * @param DataMode [DataMode=1] */ - OpenStoredProcedure(ProcedureName: any, View?: AcView, DataMode?: AcOpenDataMode): void; + OpenStoredProcedure(ProcedureName: string, View?: AcView, DataMode?: AcOpenDataMode): void; /** - * @param Access.AcView [View=0] - * @param Access.AcOpenDataMode [DataMode=1] + * @param View [View=0] + * @param DataMode [DataMode=1] */ - OpenTable(TableName: any, View?: AcView, DataMode?: AcOpenDataMode): void; + OpenTable(TableName: string, View?: AcView, DataMode?: AcOpenDataMode): void; /** - * @param Access.AcView [View=0] - * @param Access.AcOpenDataMode [DataMode=1] + * @param View [View=0] + * @param DataMode [DataMode=1] */ - OpenView(ViewName: any, View?: AcView, DataMode?: AcOpenDataMode): void; + OpenView(ViewName: string, View?: AcView, DataMode?: AcOpenDataMode): void; - /** @param Access.AcExportQuality [OutputQuality=0] */ - OutputTo(ObjectType: AcOutputObjectType, ObjectName: any, OutputFormat: any, OutputFile: any, AutoStart: any, TemplateFile: any, Encoding: any, OutputQuality?: AcExportQuality): void; + /** @param OutputQuality [OutputQuality=0] */ + OutputTo(ObjectType: AcOutputObjectType.acOutputModule, ObjectName: string, OutputFormat: AcOutputFormat.acFormatTXT, OutputFile: string, AutoStart: boolean, TemplateFile: string, Encoding: any, OutputQuality?: AcExportQuality): void; + + /** @param OutputQuality [OutputQuality=0] */ + OutputTo(ObjectType: AcOutputObjectType, ObjectName?: string, OutputFormat?: AcOutputFormat, OutputFile?: string, AutoStart?: boolean, TemplateFile?: string, Encoding?: any, OutputQuality?: AcExportQuality): void; OutputToOld0(ObjectType: AcOutputObjectType, ObjectName?: any, OutputFormat?: any, OutputFile?: any, AutoStart?: any, TemplateFile?: any): void; OutputToOld1(ObjectType: AcOutputObjectType, ObjectName?: any, OutputFormat?: any, OutputFile?: any, AutoStart?: any, TemplateFile?: any, Encoding?: any): void; /** - * @param Access.AcPrintRange [PrintRange=0] - * @param Access.AcPrintQuality [PrintQuality=0] + * @param PrintRange [PrintRange=0] + * @param PrintQuality [PrintQuality=0] + * @param Copies [Copies=1] + * @param CollateCopies [CollateCopies=true] */ - PrintOut(PrintRange?: AcPrintRange, PageFrom?: any, PageTo?: any, PrintQuality?: AcPrintQuality, Copies?: any, CollateCopies?: any): void; + PrintOut(PrintRange: AcPrintRange.acPages, PageFrom?: number, PageTo?: number, PrintQuality?: AcPrintQuality, Copies?: number, CollateCopies?: boolean): void; - /** @param Access.AcQuitOption [Options=1] */ + /** + * @param PrintRange [PrintRange=0] + * @param PrintQuality [PrintQuality=0] + * @param Copies [Copies=1] + * @param CollateCopies [CollateCopies=true] + */ + PrintOut(PrintRange?: AcPrintRange, PageFrom?: undefined, PageTo?: undefined, PrintQuality?: AcPrintQuality, Copies?: number, CollateCopies?: boolean): void; + + /** @param Options [Options=1] */ Quit(Options?: AcQuitOption): void; RefreshRecord(): void; - /** @param Access.AcObjectType [ObjectType=-1] */ - Rename(NewName: any, ObjectType?: AcObjectType, OldName?: any): void; + /** @param ObjectType [ObjectType=-1] */ + Rename(NewName: string, ObjectType: AcObjectType, OldName: string): void; + Rename(NewName: string): void; - /** @param Access.AcObjectType [ObjectType=-1] */ - RepaintObject(ObjectType?: AcObjectType, ObjectName?: any): void; - Requery(ControlName?: any): void; + /** @param ObjectType [ObjectType=-1] */ + RepaintObject(ObjectType: AcObjectType, ObjectName: string): void; + RepaintObject(): void; + + Requery(ControlName?: string): void; Restore(): void; RunCommand(Command: AcCommand): void; - RunDataMacro(MacroName: any): void; - RunMacro(MacroName: any, RepeatCount?: any, RepeatExpression?: any): void; - RunSavedImportExport(SavedImportExportName: any): void; - RunSQL(SQLStatement: any, UseTransaction?: any): void; + RunDataMacro(MacroName: string): void; + RunMacro(MacroName: string, RepeatCount?: number, RepeatExpression?: string): void; + RunSavedImportExport(SavedImportExportName: string): void; + RunSQL(SQLStatement: string, UseTransaction?: boolean): void; - /** @param Access.AcObjectType [ObjectType=-1] */ - Save(ObjectType?: AcObjectType, ObjectName?: any): void; + /** @param ObjectType [ObjectType=-1] */ + Save(ObjectType: AcObjectType | undefined, ObjectName: string): void; + Save(): void; /** - * @param Access.AcDataObjectType [ObjectType=-1] - * @param Access.AcRecord [Record=2] + * @param ObjectType [ObjectType=-1] + * @param Record [Record=2] */ - SearchForRecord(ObjectType?: AcDataObjectType, ObjectName?: any, Record?: AcRecord, WhereCondition?: any): void; - SelectObject(ObjectType: AcObjectType, ObjectName?: any, InDatabaseWindow?: any): void; + SearchForRecord(ObjectType?: AcDataObjectType, ObjectName?: string, Record?: AcRecord, WhereCondition?: string): void; + SelectObject(ObjectType: AcObjectType, ObjectName: string | undefined, InDatabaseWindow: true): void; + SelectObject(ObjectType: AcObjectType, ObjectName: string): void; - /** @param Access.AcSendObjectType [ObjectType=-1] */ - SendObject( - ObjectType?: AcSendObjectType, ObjectName?: any, OutputFormat?: any, To?: any, Cc?: any, Bcc?: any, Subject?: any, MessageText?: any, EditMessage?: any, TemplateFile?: any): void; - SetDisplayedCategories(Show: any, Category?: any): void; - SetFilter(FilterName?: any, WhereCondition?: any, ControlName?: any): void; - SetMenuItem(MenuIndex: any, CommandIndex?: any, SubcommandIndex?: any, Flag?: any): void; - SetOrderBy(OrderBy: any, ControlName?: any): void; - SetParameter(Name: any, Expression: any): void; + /** @param ObjectType [ObjectType=-1] */ + SendObject(ObjectType?: AcSendObjectType, ObjectName?: string, OutputFormat?: AcOutputFormat, To?: string, Cc?: string, Bcc?: string, Subject?: string, MessageText?: string, EditMessage?: boolean, TemplateFile?: string): void; + SetDisplayedCategories(Show: boolean, Category?: string): void; + SetFilter(FilterName?: string, WhereCondition?: string, ControlName?: string): void; + SetMenuItem(MenuIndex: number, CommandIndex?: number, SubcommandIndex?: number, Flag?: AcSetMenuItemState): void; + SetOrderBy(OrderBy: string, ControlName?: string): void; + SetParameter(Name: string, Expression: any): void; - /** @param Access.AcProperty [Property=0] */ - SetProperty(ControlName: any, Property?: AcProperty, Value?: any): void; - SetWarnings(WarningsOn: any): void; + /** @param Property [Property=0] */ + SetProperty(ControlName: string, Property?: AcProperty, Value?: any): void; + SetWarnings(WarningsOn: boolean): void; ShowAllRecords(): void; - /** @param Access.AcShowToolbar [Show=0] */ - ShowToolbar(ToolbarName: any, Show?: AcShowToolbar): void; + /** @param Show [Show=0] */ + ShowToolbar(ToolbarName: string, Show?: AcShowToolbar): void; SingleStep(): void; /** - * @param Access.AcDataTransferType [TransferType=0] - * @param Access.AcObjectType [ObjectType=0] + * @param TransferType [TransferType=0] + * @param ObjectType [ObjectType=0] + * @param StructureOnly [StructureOnly=false\] + * @param StoreLogin [StoreLogin=false] */ - TransferDatabase( - TransferType?: AcDataTransferType, DatabaseType?: any, DatabaseName?: any, ObjectType?: AcObjectType, Source?: any, Destination?: any, StructureOnly?: any, StoreLogin?: any): void; - TransferSharePointList(TransferType: AcSharePointListTransferType, SiteAddress: any, ListID: any, ViewID?: any, TableName?: any, GetLookupDisplayValues?: any): void; + TransferDatabase(TransferType?: AcDataTransferType, DatabaseType?: DatabaseType, DatabaseName?: string, ObjectType?: AcObjectType, Source?: string, Destination?: string, StructureOnly?: boolean, StoreLogin?: boolean): void; + TransferSharePointList(TransferType: AcSharePointListTransferType, SiteAddress: string, ListID: string, ViewID?: string, TableName?: string, GetLookupDisplayValues?: boolean): void; /** - * @param Access.AcDataTransferType [TransferType=0] - * @param Access.AcSpreadSheetType [SpreadsheetType=10] + * @param TransferType [TransferType=0] + * @param SpreadsheetType [SpreadsheetType=10] + * @param HasFieldNames [HasFieldNames=false] */ - TransferSpreadsheet(TransferType?: AcDataTransferType, SpreadsheetType?: AcSpreadSheetType, TableName?: any, FileName?: any, HasFieldNames?: any, Range?: any, UseOA?: any): void; - TransferSQLDatabase(Server: any, Database: any, UseTrustedConnection?: any, Login?: any, Password?: any, TransferCopyData?: any): void; + TransferSpreadsheet(TransferType: AcDataTransferType.acImport, SpreadsheetType?: AcSpreadSheetType, TableName?: string, FileName?: string, HasFieldNames?: boolean, Range?: any): void; - /** @param Access.AcTextTransferType [TransferType=0] */ - TransferText(TransferType?: AcTextTransferType, SpecificationName?: any, TableName?: any, FileName?: any, HasFieldNames?: any, HTMLTableName?: any, CodePage?: any): void; + /** + * @param TransferType [TransferType=0] + * @param SpreadsheetType [SpreadsheetType=10] + * @param HasFieldNames [HasFieldNames=false] + */ + TransferSpreadsheet(TransferType?: AcDataTransferType, SpreadsheetType?: AcSpreadSheetType, TableName?: string, FileName?: string, HasFieldNames?: boolean): void; + TransferSQLDatabase(Server: string, Database: string, UseTrustedConnection?: boolean, Login?: string, Password?: string, TransferCopyData?: boolean): void; + + /** + * @param TransferType [TransferType=0] + * @param Encoding For valid values see https://msdn.microsoft.com/en-us/library/windows/desktop/dd317756(v=vs.85).aspx + */ + TransferText(TransferType?: AcTextTransferType.acExportHTML | AcTextTransferType.acImportHTML, SpecificationName?: string, TableName?: string, FileName?: string, HasFieldNames?: boolean, HTMLTableName?: string, CodePage?: number): void; + TransferText(TransferType?: AcTextTransferType, SpecificationName?: string, TableName?: string, FileName?: string, HasFieldNames?: boolean, HTMLTableName?: undefined, CodePage?: number): void; } class EmptyCell { @@ -4559,7 +4532,7 @@ declare namespace Access { readonly LayoutID: number; Left: number; LeftPadding: number; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; readonly Parent: any; readonly Properties: Properties; @@ -4577,13 +4550,12 @@ declare namespace Access { Width: number; } - class Entities { - private 'Access.Entities_typekey': Entities; - private constructor(); + interface Entities { readonly Count: number; IsMemberSafe(dispid: number): boolean; Item(Index: any): Entity; readonly Parent: any; + (Index: any): Entity; } class Entity { @@ -4671,7 +4643,7 @@ declare namespace Access { BeforeUpdateMacro: string; BeginBatchEdit: string; BeginBatchEditMacro: string; - Bookmark: any; + Bookmark: ADODB.Bookmark | DAO.Bookmark; BorderStyle: number; Caption: string; readonly ChartSpace: any; @@ -4732,8 +4704,8 @@ declare namespace Access { FrozenColumns: number; /** - * @param number [Right=0] - * @param number [Down=0] + * @param Right [Right=0] + * @param Down [Down=0] */ GoToPage(PageNumber: number, Right?: number, Down?: number): void; GridX: number; @@ -4760,7 +4732,7 @@ declare namespace Access { readonly Module: Module; MouseWheel: string; MouseWheelMacro: string; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Moveable: boolean; Name: string; NavigationButtons: boolean; @@ -4824,7 +4796,7 @@ declare namespace Access { OnUndoMacro: string; OnUnload: string; OnUnloadMacro: string; - OpenArgs: any; + OpenArgs: string; OrderBy: string; OrderByOn: boolean; OrderByOnLoad: boolean; @@ -4856,8 +4828,8 @@ declare namespace Access { Recalc(): void; RecordLocks: number; RecordSelectors: boolean; - Recordset: any; - readonly RecordsetClone: any; + Recordset: DAO.Recordset | ADODB.Recordset | null; + readonly RecordsetClone: DAO.Recordset | ADODB.Recordset; RecordsetType: number; RecordSource: string; RecordSourceQualifier: string; @@ -4870,7 +4842,7 @@ declare namespace Access { RollbackTransactionMacro: string; RowHeight: number; ScrollBars: number; - Section(Index: any): Section; + Section(Index: AcFormSection | string): Section; SectionOld(Index: any): Section; SelectionChange: string; SelectionChangeMacro: string; @@ -4932,8 +4904,15 @@ declare namespace Access { LongestBarLimit: AcFormatBarLimits; LongestBarValue: string; - /** @param Access.AcFormatConditionOperator [Operator=0] */ - Modify(Type: AcFormatConditionType, Operator?: AcFormatConditionOperator, Expression1?: any, Expression2?: any): void; + /** @param Operator [Operator=0] */ + Modify(Type: AcFormatConditionType.acExpression, Operator: undefined, Expression1: string | number | boolean): void; + + /** @param Operator [Operator=0] */ + Modify(Type: AcFormatConditionType, Operator: AcFormatConditionOperator.acBetween | AcFormatConditionOperator.acNotBetween, Expression1: string | number | boolean, Expression2: string | number | boolean): void; + + /** @param Operator [Operator=0] */ + Modify(Type: AcFormatConditionType, Operator?: AcFormatConditionOperator, Expression1?: string | number | boolean): void; + readonly Operator: AcFormatConditionOperator; ShortestBarLimit: AcFormatBarLimits; ShortestBarValue: string; @@ -4941,475 +4920,32 @@ declare namespace Access { readonly Type: AcFormatConditionType; } - class FormatConditions { - private 'Access.FormatConditions_typekey': FormatConditions; - private constructor(); + interface FormatConditions { + /** @param Operator [Operator=0] */ + Add(Type: AcFormatConditionType.acExpression, Operator: undefined, Expression1: string | number | boolean): FormatCondition; + + /** @param Operator [Operator=0] */ + Add(Type: AcFormatConditionType, Operator: AcFormatConditionOperator.acBetween | AcFormatConditionOperator.acNotBetween, Expression1: string | number | boolean, Expression2: string | number | boolean): FormatCondition; + + /** @param Operator [Operator=0] */ + Add(Type: AcFormatConditionType, Operator?: AcFormatConditionOperator, Expression1?: string | number | boolean): FormatCondition; - /** @param Access.AcFormatConditionOperator [Operator=0] */ - Add(Type: AcFormatConditionType, Operator?: AcFormatConditionOperator, Expression1?: any, Expression2?: any): FormatCondition; readonly Application: Application; readonly Count: number; Delete(): void; IsMemberSafe(dispid: number): boolean; - Item(Index: any): FormatCondition; + Item(Index: number): FormatCondition; readonly Parent: any; + (Index: number): FormatCondition; } - class FormOld { - private 'Access.FormOld_typekey': FormOld; - private constructor(); - _Evaluate(bstrExpr: string, ...ppsa: any[]): any; - _Name: string; - accChild(varChild: any): any; - readonly accChildCount: number; - accDefaultAction(varChild?: any): string; - accDescription(varChild?: any): string; - accDoDefaultAction(varChild?: any): void; - readonly accFocus: any; - accHelp(varChild?: any): string; - accHelpTopic(pszHelpFile: string, varChild?: any): number; - accHitTest(xLeft: number, yTop: number): any; - accKeyboardShortcut(varChild?: any): string; - accLocation(pxLeft: number, pyTop: number, pcxWidth: number, pcyHeight: number, varChild?: any): void; - accName(varChild?: any): string; - accNavigate(navDir: number, varStart?: any): any; - readonly accParent: any; - accRole(varChild?: any): any; - accSelect(flagsSelect: number, varChild?: any): void; - readonly accSelection: any; - accState(varChild?: any): any; - accValue(varChild?: any): string; - acHiddenCurrentPage: number; - readonly ActiveControl: Control; - AfterDelConfirm: string; - AfterInsert: string; - AfterUpdate: string; - AllowAdditions: boolean; - AllowDeletions: boolean; - AllowDesignChanges: boolean; - AllowEditing: boolean; - AllowEdits: boolean; - AllowFilters: boolean; - AllowUpdating: number; - readonly Application: Application; - AutoCenter: boolean; - AutoResize: boolean; - BeforeDelConfirm: string; - BeforeInsert: string; - BeforeUpdate: string; - Bookmark: any; - BorderStyle: number; - Caption: string; - CloseButton: boolean; - readonly ConnectControl: Control; - ConnectSynch: number; - ControlBox: boolean; - readonly Controls: Controls; - Count: number; - CurrentRecord: number; - CurrentSectionLeft: number; - CurrentSectionTop: number; - CurrentView: number; - Cycle: number; - DataEntry: boolean; - DatasheetBackColor: number; - DatasheetCellsEffect: number; - DatasheetFontHeight: number; - DatasheetFontItalic: boolean; - DatasheetFontName: string; - DatasheetFontUnderline: boolean; - DatasheetFontWeight: number; - DatasheetForeColor: number; - DatasheetGridlinesBehavior: number; - DatasheetGridlinesColor: number; - DefaultControl(ControlType: number): Control; - DefaultEditing: number; - DefaultView: number; - Dirty: boolean; - DividingLines: boolean; - readonly Dynaset: any; - FastLaserPrinting: boolean; - Filter: string; - FilterOn: boolean; - readonly Form: Form; - FormName: string; - FrozenColumns: number; - - /** - * @param number [Right=0] - * @param number [Down=0] - */ - GoToPage(PageNumber: number, Right?: number, Down?: number): void; - GridX: number; - GridY: number; - HasModule: boolean; - HelpContextId: number; - HelpFile: string; - Hwnd: number; - InputParameters: string; - InsideHeight: number; - InsideWidth: number; - KeyPreview: boolean; - LayoutForPrint: boolean; - LogicalPageHeight: number; - LogicalPageWidth: number; - MaxButton: boolean; - MaxRecButton: boolean; - MaxRecords: number; - MenuBar: string; - MinButton: boolean; - MinMaxButtons: number; - Modal: boolean; - readonly Module: Module; - Name: string; - NavigationButtons: boolean; - readonly NewRecord: number; - OnActivate: string; - OnApplyFilter: string; - OnClick: string; - OnClose: string; - OnCurrent: string; - OnDblClick: string; - OnDeactivate: string; - OnDelete: string; - OnDirty: string; - OnError: string; - OnFilter: string; - OnGotFocus: string; - OnInsert: string; - OnKeyDown: string; - OnKeyPress: string; - OnKeyUp: string; - OnLoad: string; - OnLostFocus: string; - OnMenu: string; - OnMouseDown: string; - OnMouseMove: string; - OnMouseUp: string; - OnOpen: string; - OnResize: string; - OnTimer: string; - OnUnload: string; - OpenArgs: any; - OrderBy: string; - OrderByOn: boolean; - Orientation: number; - Page: number; - Pages: number; - Painting: boolean; - PaintPalette: any; - PaletteSource: string; - readonly Parent: any; - Picture: string; - PictureAlignment: number; - PictureData: any; - PicturePalette: any; - PictureSizeMode: number; - PictureTiling: boolean; - PictureType: number; - PopUp: boolean; - readonly Properties: Properties; - PrtDevMode: any; - PrtDevNames: any; - PrtMip: any; - Recalc(): void; - RecordLocks: number; - RecordSelectors: boolean; - Recordset: any; - readonly RecordsetClone: any; - RecordsetType: number; - RecordSource: string; - Refresh(): void; - Repaint(): void; - Requery(): void; - ResyncCommand: string; - RowHeight: number; - ScrollBars: number; - Section(Index: any): Section; - SelHeight: number; - SelLeft: number; - SelTop: number; - SelWidth: number; - ServerFilter: string; - ServerFilterByForm: boolean; - SetFocus(): void; - ShortcutMenu: boolean; - ShortcutMenuBar: string; - ShowGrid: boolean; - SubdatasheetExpanded: boolean; - SubdatasheetHeight: number; - TabularCharSet: number; - TabularFamily: number; - Tag: string; - TimerInterval: number; - Toolbar: string; - Undo(): void; - UniqueTable: string; - ViewsAllowed: number; - Visible: boolean; - WhatsThisButton: boolean; - Width: number; - WindowHeight: number; - WindowWidth: number; - ZoomControl: number; - } - - class FormOldV10 { - private 'Access.FormOldV10_typekey': FormOldV10; - private constructor(); - _Evaluate(bstrExpr: string, ...ppsa: any[]): any; - _Name: string; - accChild(varChild: any): any; - readonly accChildCount: number; - accDefaultAction(varChild?: any): string; - accDescription(varChild?: any): string; - accDoDefaultAction(varChild?: any): void; - readonly accFocus: any; - accHelp(varChild?: any): string; - accHelpTopic(pszHelpFile: string, varChild?: any): number; - accHitTest(xLeft: number, yTop: number): any; - accKeyboardShortcut(varChild?: any): string; - accLocation(pxLeft: number, pyTop: number, pcxWidth: number, pcyHeight: number, varChild?: any): void; - accName(varChild?: any): string; - accNavigate(navDir: number, varStart?: any): any; - readonly accParent: any; - accRole(varChild?: any): any; - accSelect(flagsSelect: number, varChild?: any): void; - readonly accSelection: any; - accState(varChild?: any): any; - accValue(varChild?: any): string; - acHiddenCurrentPage: number; - readonly ActiveControl: Control; - AfterBeginTransaction: string; - AfterCommitTransaction: string; - AfterDelConfirm: string; - AfterFinalRender: string; - AfterInsert: string; - AfterLayout: string; - AfterRender: string; - AfterUpdate: string; - AllowAdditions: boolean; - AllowDatasheetView: boolean; - AllowDeletions: boolean; - AllowDesignChanges: boolean; - AllowEditing: boolean; - AllowEdits: boolean; - AllowFilters: boolean; - AllowFormView: boolean; - AllowPivotChartView: boolean; - AllowPivotTableView: boolean; - AllowUpdating: number; - readonly Application: Application; - AutoCenter: boolean; - AutoResize: boolean; - BatchUpdates: boolean; - BeforeBeginTransaction: string; - BeforeCommitTransaction: string; - BeforeDelConfirm: string; - BeforeInsert: string; - BeforeQuery: string; - BeforeRender: string; - BeforeScreenTip: string; - BeforeUpdate: string; - BeginBatchEdit: string; - Bookmark: any; - BorderStyle: number; - Caption: string; - readonly ChartSpace: any; - CloseButton: boolean; - CommandBeforeExecute: string; - CommandChecked: string; - CommandEnabled: string; - CommandExecute: string; - CommitOnClose: number; - CommitOnNavigation: boolean; - readonly ConnectControl: Control; - ConnectSynch: number; - ControlBox: boolean; - readonly Controls: Controls; - Count: number; - CurrentRecord: number; - CurrentSectionLeft: number; - CurrentSectionTop: number; - CurrentView: number; - Cycle: number; - DataChange: string; - DataEntry: boolean; - DataSetChange: string; - DatasheetBackColor: number; - DatasheetBorderLineStyle: number; - DatasheetCellsEffect: number; - DatasheetColumnHeaderUnderlineStyle: number; - DatasheetFontHeight: number; - DatasheetFontItalic: boolean; - DatasheetFontName: string; - DatasheetFontUnderline: boolean; - DatasheetFontWeight: number; - DatasheetForeColor: number; - DatasheetGridlinesBehavior: number; - DatasheetGridlinesColor: number; - DefaultControl(ControlType: number): Control; - DefaultEditing: number; - DefaultView: number; - Dirty: boolean; - DividingLines: boolean; - readonly Dynaset: any; - FastLaserPrinting: boolean; - FetchDefaults: boolean; - Filter: string; - FilterOn: boolean; - readonly Form: Form; - FormName: string; - FrozenColumns: number; - - /** - * @param number [Right=0] - * @param number [Down=0] - */ - GoToPage(PageNumber: number, Right?: number, Down?: number): void; - GridX: number; - GridY: number; - HasModule: boolean; - HelpContextId: number; - HelpFile: string; - HorizontalDatasheetGridlineStyle: number; - Hwnd: number; - InputParameters: string; - InsideHeight: number; - InsideWidth: number; - KeyPreview: boolean; - LayoutForPrint: boolean; - LogicalPageHeight: number; - LogicalPageWidth: number; - MaxButton: boolean; - MaxRecButton: boolean; - MaxRecords: number; - MenuBar: string; - MinButton: boolean; - MinMaxButtons: number; - Modal: boolean; - readonly Module: Module; - MouseWheel: string; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; - Moveable: boolean; - Name: string; - NavigationButtons: boolean; - readonly NewRecord: number; - OnActivate: string; - OnApplyFilter: string; - OnClick: string; - OnClose: string; - OnConnect: string; - OnCurrent: string; - OnDblClick: string; - OnDeactivate: string; - OnDelete: string; - OnDirty: string; - OnDisconnect: string; - OnError: string; - OnFilter: string; - OnGotFocus: string; - OnInsert: string; - OnKeyDown: string; - OnKeyPress: string; - OnKeyUp: string; - OnLoad: string; - OnLostFocus: string; - OnMenu: string; - OnMouseDown: string; - OnMouseMove: string; - OnMouseUp: string; - OnOpen: string; - OnRecordExit: string; - OnResize: string; - OnTimer: string; - OnUndo: string; - OnUnload: string; - OpenArgs: any; - OrderBy: string; - OrderByOn: boolean; - Orientation: number; - Page: number; - Pages: number; - Painting: boolean; - PaintPalette: any; - PaletteSource: string; - readonly Parent: any; - Picture: string; - PictureAlignment: number; - PictureData: any; - PicturePalette: any; - PictureSizeMode: number; - PictureTiling: boolean; - PictureType: number; - readonly PivotTable: any; - PivotTableChange: string; - PopUp: boolean; - Printer: Printer; - readonly Properties: Properties; - PrtDevMode: any; - PrtDevNames: any; - PrtMip: any; - Query: string; - Recalc(): void; - RecordLocks: number; - RecordSelectors: boolean; - Recordset: any; - readonly RecordsetClone: any; - RecordsetType: number; - RecordSource: string; - RecordSourceQualifier: string; - Refresh(): void; - Repaint(): void; - Requery(): void; - ResyncCommand: string; - RollbackTransaction: string; - RowHeight: number; - ScrollBars: number; - Section(Index: any): Section; - SelectionChange: string; - SelHeight: number; - SelLeft: number; - SelTop: number; - SelWidth: number; - ServerFilter: string; - ServerFilterByForm: boolean; - SetFocus(): void; - ShortcutMenu: boolean; - ShortcutMenuBar: string; - ShowGrid: boolean; - SubdatasheetExpanded: boolean; - SubdatasheetHeight: number; - TabularCharSet: number; - TabularFamily: number; - Tag: string; - TimerInterval: number; - Toolbar: string; - Undo(): void; - UndoBatchEdit: string; - UniqueTable: string; - UseDefaultPrinter: boolean; - VerticalDatasheetGridlineStyle: number; - ViewChange: string; - ViewsAllowed: number; - Visible: boolean; - WhatsThisButton: boolean; - Width: number; - WindowHeight: number; - readonly WindowLeft: number; - readonly WindowTop: number; - WindowWidth: number; - ZoomControl: number; - } - - class Forms { - private 'Access.Forms_typekey': Forms; - private constructor(); + interface Forms { readonly Application: Application; readonly Count: number; IsMemberSafe(dispid: number): boolean; Item(Index: number | string): Form; readonly Parent: any; + (Index: number | string): Form; } class GroupLevel { @@ -5437,10 +4973,10 @@ declare namespace Access { EmailSubject: string; /** - * @param boolean [NewWindow=false] - * @param boolean [AddHistory=true] - * @param Office.MsoExtraInfoMethod [Method=0] - * @param string [HeaderInfo=''] + * @param NewWindow [NewWindow=false] + * @param AddHistory [AddHistory=true] + * @param Method [Method=0] + * @param HeaderInfo [HeaderInfo=''] */ Follow(NewWindow?: boolean, AddHistory?: boolean, ExtraInfo?: any, Method?: Office.MsoExtraInfoMethod, HeaderInfo?: string): void; IsMemberSafe(dispid: number): boolean; @@ -5502,7 +5038,7 @@ declare namespace Access { readonly LayoutID: number; Left: number; LeftPadding: number; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; ObjectPalette: any; OldBorderStyle: number; @@ -5547,22 +5083,22 @@ declare namespace Access { readonly Application: Application; Delete(): void; Description: string; - Execute(Prompt?: any): void; + Execute(Prompt?: boolean): void; IsMemberSafe(dispid: number): boolean; Name: string; readonly Parent: any; XML: string; } - class ImportExportSpecifications { - private 'Access.ImportExportSpecifications_typekey': ImportExportSpecifications; - private constructor(); + // tslint:disable-next-line:interface-name + interface ImportExportSpecifications { Add(Name: string, SpecificationDefinition: string): ImportExportSpecification; readonly Application: Application; readonly Count: number; IsMemberSafe(dispid: number): boolean; - Item(Index: any): ImportExportSpecification; + Item(Index: number | string): ImportExportSpecification; readonly Parent: any; + (Index: number | string): ImportExportSpecification; } class Label { @@ -5647,7 +5183,7 @@ declare namespace Access { LeftMargin: number; LeftPadding: number; LineSpacing: number; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; NumeralShapes: number; OldBorderStyle: number; @@ -5709,7 +5245,7 @@ declare namespace Access { IsVisible: boolean; Left: number; LineSlant: boolean; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; OldBorderStyle: number; readonly Parent: any; @@ -5749,7 +5285,7 @@ declare namespace Access { accState(varChild?: any): any; accValue(varChild?: any): string; AddColon: boolean; - AddItem(Item: string, Index?: any): void; + AddItem(Item: string, Index?: number): void; AfterUpdate: string; AfterUpdateMacro: string; AllowValueListEdits: boolean; @@ -5770,7 +5306,7 @@ declare namespace Access { BorderWidth: number; BottomPadding: number; BoundColumn: number; - Column(Index: number, Row?: any): any; + Column(Index: number, Row?: number): any; ColumnCount: number; ColumnHeads: boolean; ColumnHidden: boolean; @@ -5834,7 +5370,7 @@ declare namespace Access { ListIndex: number; ListItemsEditForm: string; Locked: boolean; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; MultiSelect: number; Name: string; NumeralShapes: number; @@ -5867,8 +5403,8 @@ declare namespace Access { readonly Parent: any; readonly Properties: Properties; ReadingOrder: number; - Recordset: any; - RemoveItem(Index: any): void; + Recordset: DAO.Recordset | ADODB.Recordset; + RemoveItem(Index: number | string): void; Requery(): void; RightPadding: number; RowSource: string; @@ -5909,15 +5445,14 @@ declare namespace Access { Value: any; } - class LocalVars { - private 'Access.LocalVars_typekey': LocalVars; - private constructor(); + interface LocalVars { Add(Name: string, Value: any): void; readonly Application: Application; readonly Count: number; IsMemberSafe(dispid: number): boolean; Item(Index: any): LocalVar; readonly Parent: any; + (Index: any): LocalVar; } class MacroError { @@ -5944,9 +5479,9 @@ declare namespace Access { DeleteLines(StartLine: number, Count: number): void; /** - * @param boolean [WholeWord=false] - * @param boolean [MatchCase=false] - * @param boolean [PatternSearch=false] + * @param WholeWord [WholeWord=false] + * @param MatchCase [MatchCase=false] + * @param PatternSearch [PatternSearch=false] */ Find(Target: string, StartLine: number, StartColumn: number, EndLine: number, EndColumn: number, WholeWord?: boolean, MatchCase?: boolean, PatternSearch?: boolean): boolean; InsertLines(Line: number, String: string): void; @@ -5963,14 +5498,13 @@ declare namespace Access { readonly Type: AcModuleType; } - class Modules { - private 'Access.Modules_typekey': Modules; - private constructor(); + interface Modules { readonly Application: Application; readonly Count: number; IsMemberSafe(dispid: number): boolean; - Item(Index: any): Module; + Item(Index: number | string): Module; readonly Parent: any; + (Index: number | string): Module; } class NavigationButton { @@ -6075,7 +5609,7 @@ declare namespace Access { readonly LayoutID: number; readonly Left: number; LeftPadding: number; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; NavigationTargetName: string; NavigationWhereClause: string; @@ -6223,7 +5757,7 @@ declare namespace Access { Left: number; LeftPadding: number; LineSpacing: number; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; NumeralShapes: number; OldBorderStyle: number; @@ -6360,7 +5894,7 @@ declare namespace Access { LinkMasterFields: string; Locked: boolean; LpOleObject: number; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; readonly Object: any; ObjectPalette: any; @@ -6426,7 +5960,7 @@ declare namespace Access { private 'Access.Operation_typekey': Operation; private constructor(); - /** @param string [bstrParameters=''] */ + /** @param bstrParameters [bstrParameters=''] */ Execute(bstrParameters?: string): any; IsMemberSafe(dispid: number): boolean; readonly Name: string; @@ -6434,13 +5968,12 @@ declare namespace Access { readonly WSParameters: WSParameters; } - class Operations { - private 'Access.Operations_typekey': Operations; - private constructor(); + interface Operations { readonly Count: number; IsMemberSafe(dispid: number): boolean; - Item(Index: any): Operation; + Item(Index: number | string): Operation; readonly Parent: any; + (Index: number | string): Operation; } class OptionButton { @@ -6522,7 +6055,7 @@ declare namespace Access { Left: number; LeftPadding: number; Locked: boolean; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; OldBorderStyle: number; readonly OldValue: any; @@ -6644,7 +6177,7 @@ declare namespace Access { LabelY: number; Left: number; Locked: boolean; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; OldBorderStyle: number; readonly OldValue: any; @@ -6723,7 +6256,7 @@ declare namespace Access { IsMemberSafe(dispid: number): boolean; IsVisible: boolean; Left: number; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; OnClick: string; OnClickMacro: string; @@ -6767,7 +6300,7 @@ declare namespace Access { IsMemberSafe(dispid: number): boolean; IsVisible: boolean; Left: number; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; readonly Parent: any; readonly Properties: Properties; @@ -6778,14 +6311,13 @@ declare namespace Access { Visible: boolean; } - class Pages { - private 'Access.Pages_typekey': Pages; - private constructor(); - Add(Before?: any): Page; + interface Pages { + Add(Before?: number): Page; readonly Count: number; IsMemberSafe(dispid: number): boolean; - Item(Index: any): Page; - Remove(Item?: any): void; + Item(Index: number | string): Page; + Remove(Item?: number): void; + (Index: number | string): Page; } class PaletteButton { @@ -6826,7 +6358,7 @@ declare namespace Access { LabelY: number; Left: number; Locked: boolean; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; readonly OldValue: any; OnClick: string; @@ -6902,24 +6434,22 @@ declare namespace Access { TopMargin: number; } - class Printers { - private 'Access.Printers_typekey': Printers; - private constructor(); + interface Printers { readonly Application: Application; readonly Count: number; IsMemberSafe(dispid: number): boolean; - Item(Index: any): Printer; + Item(Index: number | string): Printer; readonly Parent: any; + (Index: number | string): Printer; } - class Properties { - private 'Access.Properties_typekey': Properties; - private constructor(); + interface Properties { readonly Application: Application; readonly Count: number; IsMemberSafe(dispid: number): boolean; - Item(Index: any): any; + Item(Index: number | string): AccessProperty; readonly Parent: any; + (Index: number | string): AccessProperty; } class Rectangle { @@ -6950,7 +6480,7 @@ declare namespace Access { IsMemberSafe(dispid: number): boolean; IsVisible: boolean; Left: number; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; OldBorderStyle: number; OnClick: string; @@ -6990,16 +6520,15 @@ declare namespace Access { readonly Name: string; } - class References { - private 'Access.References_typekey': References; - private constructor(); + interface References { AddFromFile(FileName: string): Reference; AddFromGuid(Guid: string, Major: number, Minor: number): Reference; readonly Count: number; IsMemberSafe(dispid: number): boolean; - Item(var_0: any): Reference; + Item(var_0: number | string): Reference; readonly Parent: any; Remove(Reference: Reference): void; + (var_0: number | string): Reference; } class Report { @@ -7075,7 +6604,7 @@ declare namespace Access { readonly Module: Module; MouseWheel: string; MouseWheelMacro: string; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Moveable: boolean; MoveLayout: boolean; Name: string; @@ -7129,7 +6658,7 @@ declare namespace Access { OnTimerMacro: string; OnUnload: string; OnUnloadMacro: string; - OpenArgs: any; + OpenArgs: string; OrderBy: string; OrderByOn: boolean; OrderByOnLoad: boolean; @@ -7161,7 +6690,7 @@ declare namespace Access { PrtMip: any; PSet(flags: number, X: number, Y: number, color: number): void; RecordLocks: number; - Recordset: any; + Recordset: DAO.Recordset | ADODB.Recordset | null; RecordSource: string; RecordSourceQualifier: string; readonly Report: Report; @@ -7174,7 +6703,7 @@ declare namespace Access { ScaleTop: number; ScaleWidth: number; ScrollBars: number; - Section(Index: any): Section; + Section(Index: AcReportSection | string): Section; SectionOld(Index: any): Section; ServerFilter: string; readonly Shape: string; @@ -7196,281 +6725,31 @@ declare namespace Access { ZoomControl: number; } - class ReportOld { - private 'Access.ReportOld_typekey': ReportOld; - private constructor(); - _Evaluate(bstrExpr: string, ...ppsa: any[]): any; - _Name: string; - acHiddenCurrentPage: number; - readonly ActiveControl: Control; - readonly Application: Application; - Caption: string; - Circle(flags: number, X: number, Y: number, radius: number, color: number, start: number, end: number, aspect: number): void; - readonly Controls: Controls; - Count: number; - CurrentRecord: number; - CurrentX: number; - CurrentY: number; - DateGrouping: number; - DefaultControl(ControlType: number): Control; - Dirty: boolean; - DrawMode: number; - DrawStyle: number; - DrawWidth: number; - FastLaserPrinting: boolean; - FillColor: number; - FillStyle: number; - Filter: string; - FilterOn: boolean; - FontBold: number; - FontItalic: number; - FontName: string; - FontSize: number; - FontUnderline: number; - ForeColor: number; - FormatCount: number; - FormName: string; - GridX: number; - GridY: number; - GroupLevel(Index: number): GroupLevel; - GrpKeepTogether: number; - HasData: number; - HasModule: boolean; - Height: number; - HelpContextId: number; - HelpFile: string; - Hwnd: number; - InputParameters: string; - LayoutForPrint: boolean; - Left: number; - Line(flags: number, x1: number, y1: number, x2: number, y2: number, color: number): void; - LogicalPageHeight: number; - LogicalPageWidth: number; - MaxButton: boolean; - MenuBar: string; - MinButton: boolean; - readonly Module: Module; - MoveLayout: boolean; - Name: string; - NextRecord: boolean; - OnActivate: string; - OnClose: string; - OnDeactivate: string; - OnError: string; - OnMenu: string; - OnNoData: string; - OnOpen: string; - OnPage: string; - OrderBy: string; - OrderByOn: boolean; - Orientation: number; - Page: number; - PageFooter: number; - PageHeader: number; - Pages: number; - Painting: boolean; - PaintPalette: any; - PaletteSource: string; - readonly Parent: any; - Picture: string; - PictureAlignment: number; - PictureData: any; - PicturePages: number; - PicturePalette: any; - PictureSizeMode: number; - PictureTiling: boolean; - PictureType: number; - Print(Expr: string): void; - PrintCount: number; - PrintSection: boolean; - readonly Properties: Properties; - PrtDevMode: any; - PrtDevNames: any; - PrtMip: any; - PSet(flags: number, X: number, Y: number, color: number): void; - RecordLocks: number; - RecordSource: string; - readonly Report: Report; - Scale(flags: number, x1: number, y1: number, x2: number, y2: number): void; - ScaleHeight: number; - ScaleLeft: number; - ScaleMode: number; - ScaleTop: number; - ScaleWidth: number; - Section(Index: any): Section; - ServerFilter: string; - ShortcutMenuBar: string; - Tag: string; - TextHeight(Expr: string): number; - TextWidth(Expr: string): number; - Toolbar: string; - Top: number; - Visible: boolean; - Width: number; - ZoomControl: number; - } - - class ReportOldV10 { - private 'Access.ReportOldV10_typekey': ReportOldV10; - private constructor(); - _Evaluate(bstrExpr: string, ...ppsa: any[]): any; - _Name: string; - acHiddenCurrentPage: number; - readonly ActiveControl: Control; - readonly Application: Application; - AutoCenter: boolean; - AutoResize: boolean; - BorderStyle: number; - Caption: string; - Circle(flags: number, X: number, Y: number, radius: number, color: number, start: number, end: number, aspect: number): void; - CloseButton: boolean; - ControlBox: boolean; - readonly Controls: Controls; - Count: number; - CurrentRecord: number; - CurrentX: number; - CurrentY: number; - DateGrouping: number; - DefaultControl(ControlType: number): Control; - Dirty: boolean; - DrawMode: number; - DrawStyle: number; - DrawWidth: number; - FastLaserPrinting: boolean; - FillColor: number; - FillStyle: number; - Filter: string; - FilterOn: boolean; - FontBold: number; - FontItalic: number; - FontName: string; - FontSize: number; - FontUnderline: number; - ForeColor: number; - FormatCount: number; - FormName: string; - GridX: number; - GridY: number; - GroupLevel(Index: number): GroupLevel; - GrpKeepTogether: number; - HasData: number; - HasModule: boolean; - Height: number; - HelpContextId: number; - HelpFile: string; - Hwnd: number; - InputParameters: string; - LayoutForPrint: boolean; - Left: number; - Line(flags: number, x1: number, y1: number, x2: number, y2: number, color: number): void; - LogicalPageHeight: number; - LogicalPageWidth: number; - MaxButton: boolean; - MenuBar: string; - MinButton: boolean; - MinMaxButtons: number; - Modal: boolean; - readonly Module: Module; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; - Moveable: boolean; - MoveLayout: boolean; - Name: string; - NextRecord: boolean; - OnActivate: string; - OnClose: string; - OnDeactivate: string; - OnError: string; - OnMenu: string; - OnNoData: string; - OnOpen: string; - OnPage: string; - OpenArgs: any; - OrderBy: string; - OrderByOn: boolean; - Orientation: number; - Page: number; - PageFooter: number; - PageHeader: number; - Pages: number; - Painting: boolean; - PaintPalette: any; - PaletteSource: string; - readonly Parent: any; - Picture: string; - PictureAlignment: number; - PictureData: any; - PicturePages: number; - PicturePalette: any; - PictureSizeMode: number; - PictureTiling: boolean; - PictureType: number; - PopUp: boolean; - Print(Expr: string): void; - PrintCount: number; - Printer: Printer; - PrintSection: boolean; - readonly Properties: Properties; - PrtDevMode: any; - PrtDevNames: any; - PrtMip: any; - PSet(flags: number, X: number, Y: number, color: number): void; - RecordLocks: number; - Recordset: any; - RecordSource: string; - RecordSourceQualifier: string; - readonly Report: Report; - Scale(flags: number, x1: number, y1: number, x2: number, y2: number): void; - ScaleHeight: number; - ScaleLeft: number; - ScaleMode: number; - ScaleTop: number; - ScaleWidth: number; - Section(Index: any): Section; - ServerFilter: string; - readonly Shape: string; - ShortcutMenuBar: string; - Tag: string; - TextHeight(Expr: string): number; - TextWidth(Expr: string): number; - Toolbar: string; - Top: number; - UseDefaultPrinter: boolean; - Visible: boolean; - Width: number; - WindowHeight: number; - readonly WindowLeft: number; - readonly WindowTop: number; - WindowWidth: number; - ZoomControl: number; - } - - class Reports { - private 'Access.Reports_typekey': Reports; - private constructor(); + interface Reports { readonly Application: Application; readonly Count: number; IsMemberSafe(dispid: number): boolean; - Item(Index: any): Report; + Item(Index: string | number): Report; readonly Parent: any; + (Index: string | number): Report; } class ReturnVar { private 'Access.ReturnVar_typekey': ReturnVar; private constructor(); - readonly _Value: any; + readonly _Value: string | number; IsMemberSafe(dispid: number): boolean; readonly Name: string; - readonly Value: any; + readonly Value: string | number; } - class ReturnVars { - private 'Access.ReturnVars_typekey': ReturnVars; - private constructor(); + interface ReturnVars { readonly Application: Application; readonly Count: number; IsMemberSafe(dispid: number): boolean; - Item(Index: any): ReturnVar; + Item(Index: number | string): ReturnVar; readonly Parent: any; + (Index: string | number): ReturnVar; } class Screen { @@ -7553,14 +6832,13 @@ declare namespace Access { readonly Type: AcResourceType; } - class SharedResources { - private 'Access.SharedResources_typekey': SharedResources; - private constructor(); + interface SharedResources { readonly Application: Application; readonly Count: number; IsMemberSafe(dispid: number): boolean; Item(Index: number): SharedResource; readonly Parent: any; + (Index: number): SharedResource; } class SmartTag { @@ -7587,25 +6865,23 @@ declare namespace Access { readonly Parent: any; } - class SmartTagActions { - private 'Access.SmartTagActions_typekey': SmartTagActions; - private constructor(); + interface SmartTagActions { readonly Application: Application; readonly Count: number; IsMemberSafe(dispid: number): boolean; - Item(Index: any): SmartTagAction; + Item(Index: number | string): SmartTagAction; readonly Parent: any; + (Index: number | string): SmartTagAction; } - class SmartTagProperties { - private 'Access.SmartTagProperties_typekey': SmartTagProperties; - private constructor(); + interface SmartTagProperties { Add(Name: string, Value: any): SmartTagProperty; readonly Application: Application; readonly Count: number; IsMemberSafe(dispid: number): boolean; - Item(Index: any): SmartTagProperty; + Item(Index: number | string): SmartTagProperty; readonly Parent: any; + (Index: number | string): SmartTagProperty; } class SmartTagProperty { @@ -7617,15 +6893,14 @@ declare namespace Access { Value: string; } - class SmartTags { - private 'Access.SmartTags_typekey': SmartTags; - private constructor(); + interface SmartTags { Add(Name: string): SmartTag; readonly Application: Application; readonly Count: number; IsMemberSafe(dispid: number): boolean; - Item(Index: any): SmartTag; + Item(Index: number | string): SmartTag; readonly Parent: any; + (Index: number | string): SmartTag; } class SubForm { @@ -7701,7 +6976,7 @@ declare namespace Access { LinkChildFields: string; LinkMasterFields: string; Locked: boolean; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; OldBorderStyle: number; OnEnter: string; @@ -7821,7 +7096,7 @@ declare namespace Access { readonly LayoutID: number; Left: number; LeftPadding: number; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; MultiRow: boolean; Name: string; readonly OldValue: any; @@ -7880,23 +7155,22 @@ declare namespace Access { class TempVar { private 'Access.TempVar_typekey': TempVar; private constructor(); - _Value: any; + _Value: number | string | boolean; IsMemberSafe(dispid: number): boolean; readonly Name: string; - Value: any; + Value: number | string | boolean; } - class TempVars { - private 'Access.TempVars_typekey': TempVars; - private constructor(); - Add(Name: string, Value: any): void; + interface TempVars { + Add(Name: string, Value: number | string | boolean): void; readonly Application: Application; readonly Count: number; IsMemberSafe(dispid: number): boolean; - Item(Index: any): TempVar; + Item(Index: number | string): TempVar; readonly Parent: any; - Remove(var_0: any): void; + Remove(Index: number | string): void; RemoveAll(): void; + (Index: number | string): TempVar; } class TextBox { @@ -8019,7 +7293,7 @@ declare namespace Access { LeftPadding: number; LineSpacing: number; Locked: boolean; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; NumeralShapes: number; OldBorderStyle: number; @@ -8200,7 +7474,7 @@ declare namespace Access { Left: number; LeftPadding: number; Locked: boolean; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; ObjectPalette: any; readonly OldValue: any; @@ -8336,7 +7610,7 @@ declare namespace Access { Left: number; LeftPadding: number; readonly LocationURL: string; - Move(Left: any, Top?: any, Width?: any, Height?: any): void; + Move(Left: number, Top?: number, Width?: number, Height?: number): void; Name: string; readonly Object: any; readonly OldValue: any; @@ -8416,14 +7690,13 @@ declare namespace Access { readonly Parent: any; } - class WebServices { - private 'Access.WebServices_typekey': WebServices; - private constructor(); + interface WebServices { readonly Application: Application; readonly Count: number; IsMemberSafe(dispid: number): boolean; - Item(Index: any): WebService; + Item(Index: number | string): WebService; readonly Parent: any; + (Index: number | string): WebService; } class WizHook { @@ -8459,12 +7732,8 @@ declare namespace Access { GetColumns(bstrBase: string): string; GetCurrentView(bstrTableName: string): number; GetDisabledExtensions(): string; - GetFileName( - hwndOwner: number, AppName: string, DlgTitle: string, OpenTitle: string, File: string, InitialDir: string, Filter: string, FilterIndex: number, View: number, - flags: number, fOpen: boolean): number; - GetFileName2( - hwndOwner: number, AppName: string, DlgTitle: string, OpenTitle: string, File: string, InitialDir: string, Filter: string, FilterIndex: number, View: number, - flags: number, fOpen: boolean, fFileSystem: any): number; + GetFileName(hwndOwner: number, AppName: string, DlgTitle: string, OpenTitle: string, File: string, InitialDir: string, Filter: string, FilterIndex: number, View: number, flags: number, fOpen: boolean): number; + GetFileName2(hwndOwner: number, AppName: string, DlgTitle: string, OpenTitle: string, File: string, InitialDir: string, Filter: string, FilterIndex: number, View: number, flags: number, fOpen: boolean, fFileSystem: any): number; GetFileOdso(bstrExt: string, bstrFilename: string): number; GetImexTblName(): string; GetInfoForColumns(bstrBase: string): string; @@ -8485,7 +7754,7 @@ declare namespace Access { NameFromActid(Actid: number): string; ObjTypOfRecordSource(RecordSource: string): number; OfficeAddInDir(): string; - OpenEmScript(pProperty: _AccessProperty, OpenMode: number, Extra: number, Version: number): number; + OpenEmScript(pProperty: AccessProperty, OpenMode: number, Extra: number, Version: number): number; OpenPictureFile(File: string, Cancelled: boolean): boolean; OpenScript(Script: string, Label: string, OpenMode: number, Extra: number, Version: number): number; ReportLeaksToFile(fRptToFile: boolean, bstrFileOut: string): void; @@ -8514,13 +7783,12 @@ declare namespace Access { readonly Type: number; } - class WSParameters { - private 'Access.WSParameters_typekey': WSParameters; - private constructor(); + interface WSParameters { readonly Count: number; IsMemberSafe(dispid: number): boolean; - Item(Index: any): WSParameter; + Item(Index: number | string): WSParameter; readonly Parent: any; + (Index: number | string): WSParameter; } namespace EventHelperTypes { @@ -8528,12 +7796,230 @@ declare namespace Access { interface WebBrowserControl_BeforeNavigate2_Parameter { Cancel: boolean; - readonly flags: any; + readonly flags: number; readonly Headers: any; readonly pDisp: any; readonly PostData: any; - readonly TargetFrameName: any; - readonly URL: any; + readonly TargetFrameName: string | null; + readonly URL: string; + } + } +} + +declare namespace AccWizObjects { + const enum WIZ_CSIDL_FLAGS { + WIZ_CSIDL_APPDATA = 26, + WIZ_CSIDL_BITBUCKET = 10, + WIZ_CSIDL_COMMON_DESKTOPDIRECTORY = 25, + WIZ_CSIDL_COMMON_PROGRAMS = 23, + WIZ_CSIDL_COMMON_STARTMENU = 22, + WIZ_CSIDL_COMMON_STARTUP = 24, + WIZ_CSIDL_CONTROLS = 3, + WIZ_CSIDL_DESKTOP = 0, + WIZ_CSIDL_DESKTOPDIRECTORY = 16, + WIZ_CSIDL_DRIVES = 17, + WIZ_CSIDL_FAVORITES = 6, + WIZ_CSIDL_FONTS = 20, + WIZ_CSIDL_NETHOOD = 19, + WIZ_CSIDL_NETWORK = 18, + WIZ_CSIDL_PERSONAL = 5, + WIZ_CSIDL_PRINTERS = 4, + WIZ_CSIDL_PRINTHOOD = 27, + WIZ_CSIDL_PROGRAMS = 2, + WIZ_CSIDL_RECENT = 8, + WIZ_CSIDL_SENDTO = 9, + WIZ_CSIDL_STARTMENU = 11, + WIZ_CSIDL_STARTUP = 7, + WIZ_CSIDL_TEMPLATES = 21, + } + + const enum WIZ_SLGP_FLAGS { + WIZ_SLGP_SHORTPATH = 1, + WIZ_SLGP_UNCPRIORITY = 2, + } + + const enum WIZ_SLR_FLAGS { + WIZ_SLR_ANY_MATCH = 2, + WIZ_SLR_NO_UI = 1, + WIZ_SLR_UPDATE = 4, + } + + const enum WIZ_SW_FLAGS { + WIZ_SW_MAXIMIZE = 3, + WIZ_SW_MINIMIZE = 7, + WIZ_SW_NORMAL = 5, + } + + /** Field List Control */ + class FieldList { + private 'AccWizObjects.FieldList_typekey': FieldList; + private constructor(); + AddFieldList(bstrCaption: string, nLeft: number, nTop: number, nWidth: number, nHeight: number, nMultiSelectType: number, cCols: number, fShowPictures: boolean): void; + AddJoinLine(IFieldList: number, iField: number, iForeignFieldList: number, iForeignField: number, lAttribs: number): void; + DeleteFieldList(IFieldList: number): void; + DeleteJoinLine(IJoinLine: number): void; + readonly FieldListCount: number; + FieldLists(IFieldList: number): any; + HScrollPos: number; + readonly JoinLineCount: number; + JoinLines(IJoinLine: number): any; + PersistentHighlight: boolean; + Picture: stdole.IPictureDisp; + PictureCols: number; + PictureRows: number; + ScrollBars: number; + SelectedFieldListIndex: number; + SetCursor(nCursorID: number): void; + VScrollPos: number; + } + + /** ImexGrid Control */ + class ImexGrid { + private 'AccWizObjects.ImexGrid_typekey': ImexGrid; + private constructor(); + AddColumn(ColumnCaption: string, ColumnWidth: number, Index: number): void; + AddRow(RowText: string, Index: number): void; + AllowColumnSizing: boolean; + BackColor: stdole.OLE_COLOR; + CalcBestColumns(): void; + Caption: string; + ClearColumns(): void; + ClearRows(): void; + ColumnClickBehavior: number; + readonly ColumnCount: number; + Columns(ColumnNumber: number): any; + ColumnState: any; + DeleteColumn(Index: number): void; + DeleteRow(Index: number): void; + Delimiters: string; + DrawTextLogicalOrder: boolean; + FirstRowNumber: number; + Font: stdole.IFontDisp; + GridBackColor: stdole.OLE_COLOR; + GridFont: stdole.IFontDisp; + GridHeader: number; + Painting: boolean; + Refresh(): void; + ResetHScrollPos(): void; + ResetVScrollPos(): void; + readonly RowCount: number; + RowText(RowNumber: number): string; + ShowColLines: boolean; + ShowRowHeaders: boolean; + StringDelimiters: string; + } + + interface WIZ_FILETIME { + readonly dwHighDateTime: number; + readonly dwLowDateTime: number; + } + + interface WIZ_WIN32_FIND_DATA { + readonly cAlternate: SafeArray; + readonly cFileName: SafeArray; + readonly dwFileAttributes: number; + readonly dwReserved0: number; + readonly dwReserved1: number; + readonly ftCreationTime: WIZ_FILETIME; + readonly ftLastAccessTime: WIZ_FILETIME; + readonly ftLastWriteTime: WIZ_FILETIME; + readonly nFileSizeHigh: number; + readonly nFileSizeLow: number; + } + + /** WizShellLinkA Class */ + class WizShellLinkA { + private 'AccWizObjects.WizShellLinkA_typekey': WizShellLinkA; + private constructor(); + + /** GetArguments */ + GetArguments(pszArgs: string, cchMaxPath: number): void; + + /** GetDescription */ + GetDescription(pszName: string, cchMaxName: number): void; + + /** GetHotkey */ + GetHotkey(pwHotkey: number): void; + + /** GetIconLocation */ + GetIconLocation(pszIconPath: string, cchIconPath: number, piIcon: number): void; + + /** GetIDList */ + GetIDList(ppidl: WIZ_CSIDL_FLAGS): void; + + /** GetPath */ + GetPath(pszFile: string, cchMaxPath: number, pfd: WIZ_WIN32_FIND_DATA, fflags: number): void; + + /** GetShowCmd */ + GetShowCmd(piShowCmd: WIZ_SW_FLAGS): void; + + /** GetWorkingDirectory */ + GetWorkingDirectory(pszDir: string, cchMaxPath: number): void; + + /** Resolve */ + Resolve(hWnd: number, fflags: number): void; + + /** SetArguments */ + SetArguments(pszArgs: string): void; + + /** SetDescription */ + SetDescription(pszName: string): void; + + /** SetHotkey */ + SetHotkey(wHotkey: number): void; + + /** SetIconLocation */ + SetIconLocation(pszIconPath: string, iIcon: number): void; + + /** SetIDList */ + SetIDList(pidl: WIZ_CSIDL_FLAGS): void; + + /** SetPath */ + SetPath(pszFile: string): void; + + /** SetRelativePath */ + SetRelativePath(pszPathRel: string, dwReserved: number): void; + + /** SetShowCmd */ + SetShowCmd(iShowCmd: WIZ_SW_FLAGS): void; + + /** SetWorkingDirectory */ + SetWorkingDirectory(pszDir: string): void; + } + + namespace EventHelperTypes { + type FieldList_DragOver_ArgNames = ['SourceCtlName', 'SourceFieldList', 'SourceRow', 'State', 'X', 'Y']; + + type FieldList_FldListDragDrop_ArgNames = ['SourceCtlName', 'SourceFieldList', 'SourceRow', 'TargetCtlName', 'TargetFieldList', 'TargetRow']; + + type FieldList_FldListDragOver_ArgNames = ['SourceCtlName', 'SourceFieldList', 'SourceRow', 'TargetCtlName', 'TargetFieldList', 'TargetRow', 'State']; + + interface FieldList_DragOver_Parameter { + readonly SourceCtlName: string; + readonly SourceFieldList: number; + readonly SourceRow: number; + readonly State: number; + readonly X: number; + readonly Y: number; + } + + interface FieldList_FldListDragDrop_Parameter { + readonly SourceCtlName: string; + readonly SourceFieldList: number; + readonly SourceRow: number; + readonly TargetCtlName: string; + readonly TargetFieldList: number; + readonly TargetRow: number; + } + + interface FieldList_FldListDragOver_Parameter { + readonly SourceCtlName: string; + readonly SourceFieldList: number; + readonly SourceRow: number; + readonly State: number; + readonly TargetCtlName: string; + readonly TargetFieldList: number; + readonly TargetRow: number; } } } @@ -8542,71 +8028,45 @@ interface ActiveXObject { on(obj: Access._CheckBoxInOption, event: 'BeforeUpdate' | 'DblClick' | 'Exit', argNames: ['Cancel'], handler: (this: Access._CheckBoxInOption, parameter: {Cancel: number}) => void): void; on(obj: Access._CheckBoxInOption, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: Access._CheckBoxInOption, parameter: {KeyCode: number, Shift: number}) => void): void; on(obj: Access._CheckBoxInOption, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: Access._CheckBoxInOption, parameter: {KeyAscii: number}) => void): void; - on( - obj: Access._CheckBoxInOption, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access._CheckBoxInOption, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access._CheckBoxInOption, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access._CheckBoxInOption, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access._OptionButtonInOption, event: 'BeforeUpdate' | 'DblClick' | 'Exit', argNames: ['Cancel'], handler: (this: Access._OptionButtonInOption, parameter: {Cancel: number}) => void): void; - on( - obj: Access._OptionButtonInOption, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: Access._OptionButtonInOption, parameter: {KeyCode: number, Shift: number}) => void): void; + on(obj: Access._OptionButtonInOption, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: Access._OptionButtonInOption, parameter: {KeyCode: number, Shift: number}) => void): void; on(obj: Access._OptionButtonInOption, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: Access._OptionButtonInOption, parameter: {KeyAscii: number}) => void): void; - on( - obj: Access._OptionButtonInOption, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], - handler: (this: Access._OptionButtonInOption, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access._OptionButtonInOption, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access._OptionButtonInOption, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access._PageHdrFtrInReport, event: 'DblClick', argNames: ['Cancel'], handler: (this: Access._PageHdrFtrInReport, parameter: {Cancel: number}) => void): void; - on( - obj: Access._PageHdrFtrInReport, event: 'Format', argNames: ['Cancel', 'FormatCount'], handler: ( - this: Access._PageHdrFtrInReport, parameter: {Cancel: number, FormatCount: number}) => void): void; - on( - obj: Access._PageHdrFtrInReport, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access._PageHdrFtrInReport, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access._PageHdrFtrInReport, event: 'Format', argNames: ['Cancel', 'FormatCount'], handler: (this: Access._PageHdrFtrInReport, parameter: {Cancel: number, FormatCount: number}) => void): void; + on(obj: Access._PageHdrFtrInReport, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access._PageHdrFtrInReport, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access._PageHdrFtrInReport, event: 'Print', argNames: ['Cancel', 'PrintCount'], handler: (this: Access._PageHdrFtrInReport, parameter: {Cancel: number, PrintCount: number}) => void): void; on(obj: Access._SectionInReport, event: 'DblClick', argNames: ['Cancel'], handler: (this: Access._SectionInReport, parameter: {Cancel: number}) => void): void; on(obj: Access._SectionInReport, event: 'Format', argNames: ['Cancel', 'FormatCount'], handler: (this: Access._SectionInReport, parameter: {Cancel: number, FormatCount: number}) => void): void; - on( - obj: Access._SectionInReport, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access._SectionInReport, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access._SectionInReport, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access._SectionInReport, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access._SectionInReport, event: 'Print', argNames: ['Cancel', 'PrintCount'], handler: (this: Access._SectionInReport, parameter: {Cancel: number, PrintCount: number}) => void): void; on(obj: Access._ToggleButtonInOption, event: 'BeforeUpdate' | 'DblClick' | 'Exit', argNames: ['Cancel'], handler: (this: Access._ToggleButtonInOption, parameter: {Cancel: number}) => void): void; - on( - obj: Access._ToggleButtonInOption, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: Access._ToggleButtonInOption, parameter: {KeyCode: number, Shift: number}) => void): void; + on(obj: Access._ToggleButtonInOption, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: Access._ToggleButtonInOption, parameter: {KeyCode: number, Shift: number}) => void): void; on(obj: Access._ToggleButtonInOption, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: Access._ToggleButtonInOption, parameter: {KeyAscii: number}) => void): void; - on( - obj: Access._ToggleButtonInOption, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], - handler: (this: Access._ToggleButtonInOption, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access._ToggleButtonInOption, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access._ToggleButtonInOption, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access.Attachment, event: 'BeforeUpdate' | 'DblClick' | 'Dirty' | 'Exit', argNames: ['Cancel'], handler: (this: Access.Attachment, parameter: {Cancel: number}) => void): void; on(obj: Access.Attachment, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: Access.Attachment, parameter: {KeyCode: number, Shift: number}) => void): void; on(obj: Access.Attachment, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: Access.Attachment, parameter: {KeyAscii: number}) => void): void; - on( - obj: Access.Attachment, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.Attachment, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access.Attachment, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access.Attachment, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access.BoundObjectFrame, event: 'BeforeUpdate' | 'DblClick' | 'Exit', argNames: ['Cancel'], handler: (this: Access.BoundObjectFrame, parameter: {Cancel: number}) => void): void; on(obj: Access.BoundObjectFrame, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: Access.BoundObjectFrame, parameter: {KeyCode: number, Shift: number}) => void): void; on(obj: Access.BoundObjectFrame, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: Access.BoundObjectFrame, parameter: {KeyAscii: number}) => void): void; - on( - obj: Access.BoundObjectFrame, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.BoundObjectFrame, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access.BoundObjectFrame, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access.BoundObjectFrame, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access.BoundObjectFrame, event: 'Updated', argNames: ['Code'], handler: (this: Access.BoundObjectFrame, parameter: {Code: number}) => void): void; on(obj: Access.CheckBox, event: 'BeforeUpdate' | 'DblClick' | 'Exit', argNames: ['Cancel'], handler: (this: Access.CheckBox, parameter: {Cancel: number}) => void): void; on(obj: Access.CheckBox, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: Access.CheckBox, parameter: {KeyCode: number, Shift: number}) => void): void; on(obj: Access.CheckBox, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: Access.CheckBox, parameter: {KeyAscii: number}) => void): void; - on( - obj: Access.CheckBox, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.CheckBox, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access.CheckBox, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access.CheckBox, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access.ComboBox, event: 'BeforeUpdate' | 'DblClick' | 'Dirty' | 'Exit' | 'Undo', argNames: ['Cancel'], handler: (this: Access.ComboBox, parameter: {Cancel: number}) => void): void; on(obj: Access.ComboBox, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: Access.ComboBox, parameter: {KeyCode: number, Shift: number}) => void): void; on(obj: Access.ComboBox, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: Access.ComboBox, parameter: {KeyAscii: number}) => void): void; - on( - obj: Access.ComboBox, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.ComboBox, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access.ComboBox, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access.ComboBox, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access.ComboBox, event: 'NotInList', argNames: ['NewData', 'Response'], handler: (this: Access.ComboBox, parameter: {NewData: string, Response: number}) => void): void; on(obj: Access.CommandButton, event: 'DblClick' | 'Exit', argNames: ['Cancel'], handler: (this: Access.CommandButton, parameter: {Cancel: number}) => void): void; on(obj: Access.CommandButton, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: Access.CommandButton, parameter: {KeyCode: number, Shift: number}) => void): void; on(obj: Access.CommandButton, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: Access.CommandButton, parameter: {KeyAscii: number}) => void): void; - on( - obj: Access.CommandButton, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.CommandButton, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access.CommandButton, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access.CommandButton, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access.CustomControl, event: 'Exit', argNames: ['Cancel'], handler: (this: Access.CustomControl, parameter: {Cancel: number}) => void): void; on(obj: Access.CustomControl, event: 'Updated', argNames: ['Code'], handler: (this: Access.CustomControl, parameter: {Code: number}) => void): void; on(obj: Access.Form, event: 'AfterDelConfirm', argNames: ['Status'], handler: (this: Access.Form, parameter: {Status: number}) => void): void; @@ -8614,16 +8074,9 @@ interface ActiveXObject { on(obj: Access.Form, event: 'AfterRender', argNames: ['drawObject', 'chartObject'], handler: (this: Access.Form, parameter: {readonly drawObject: any, readonly chartObject: any}) => void): void; on(obj: Access.Form, event: 'ApplyFilter', argNames: ['Cancel', 'ApplyType'], handler: (this: Access.Form, parameter: {Cancel: number, ApplyType: number}) => void): void; on(obj: Access.Form, event: 'BeforeDelConfirm', argNames: ['Cancel', 'Response'], handler: (this: Access.Form, parameter: {Cancel: number, Response: number}) => void): void; - on( - obj: Access.Form, event: 'BeforeInsert' | 'BeforeUpdate' | 'BeginBatchEdit' | 'DblClick' | 'Delete' | 'Dirty' | 'Open' | 'RecordExit' | 'Undo' | 'UndoBatchEdit' | - 'Unload', - argNames: ['Cancel'], handler: (this: Access.Form, parameter: {Cancel: number}) => void): void; - on( - obj: Access.Form, event: 'BeforeRender', argNames: ['drawObject', 'chartObject', 'Cancel'], handler: ( - this: Access.Form, parameter: {readonly drawObject: any, readonly chartObject: any, readonly Cancel: any}) => void): void; - on( - obj: Access.Form, event: 'BeforeScreenTip', argNames: ['ScreenTipText', 'SourceObject'], handler: ( - this: Access.Form, parameter: {readonly ScreenTipText: any, readonly SourceObject: any}) => void): void; + on(obj: Access.Form, event: 'BeforeInsert' | 'BeforeUpdate' | 'BeginBatchEdit' | 'DblClick' | 'Delete' | 'Dirty' | 'Open' | 'RecordExit' | 'Undo' | 'UndoBatchEdit' | 'Unload', argNames: ['Cancel'], handler: (this: Access.Form, parameter: {Cancel: number}) => void): void; + on(obj: Access.Form, event: 'BeforeRender', argNames: ['drawObject', 'chartObject', 'Cancel'], handler: (this: Access.Form, parameter: {readonly drawObject: any, readonly chartObject: any, readonly Cancel: any}) => void): void; + on(obj: Access.Form, event: 'BeforeScreenTip', argNames: ['ScreenTipText', 'SourceObject'], handler: (this: Access.Form, parameter: {readonly ScreenTipText: any, readonly SourceObject: any}) => void): void; on(obj: Access.Form, event: 'CommandBeforeExecute', argNames: ['Command', 'Cancel'], handler: (this: Access.Form, parameter: {readonly Command: any, readonly Cancel: any}) => void): void; on(obj: Access.Form, event: 'CommandChecked', argNames: ['Command', 'Checked'], handler: (this: Access.Form, parameter: {readonly Command: any, readonly Checked: any}) => void): void; on(obj: Access.Form, event: 'CommandEnabled', argNames: ['Command', 'Enabled'], handler: (this: Access.Form, parameter: {readonly Command: any, readonly Enabled: any}) => void): void; @@ -8633,141 +8086,41 @@ interface ActiveXObject { on(obj: Access.Form, event: 'Filter', argNames: ['Cancel', 'FilterType'], handler: (this: Access.Form, parameter: {Cancel: number, FilterType: number}) => void): void; on(obj: Access.Form, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: Access.Form, parameter: {KeyCode: number, Shift: number}) => void): void; on(obj: Access.Form, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: Access.Form, parameter: {KeyAscii: number}) => void): void; - on( - obj: Access.Form, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.Form, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access.Form, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access.Form, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access.Form, event: 'MouseWheel', argNames: ['Page', 'Count'], handler: (this: Access.Form, parameter: {readonly Page: boolean, readonly Count: number}) => void): void; - on( - obj: Access.FormOld, event: 'AfterBeginTransaction' | 'AfterCommitTransaction' | 'RollbackTransaction', argNames: ['Connection'], handler: ( - this: Access.FormOld, parameter: {readonly Connection: ADODB.Connection}) => void): void; - on(obj: Access.FormOld, event: 'AfterDelConfirm', argNames: ['Status'], handler: (this: Access.FormOld, parameter: {Status: number}) => void): void; - on(obj: Access.FormOld, event: 'AfterFinalRender' | 'AfterLayout', argNames: ['drawObject'], handler: (this: Access.FormOld, parameter: {readonly drawObject: any}) => void): void; - on( - obj: Access.FormOld, event: 'AfterRender', argNames: ['drawObject', 'chartObject'], handler: ( - this: Access.FormOld, parameter: {readonly drawObject: any, readonly chartObject: any}) => void): void; - on(obj: Access.FormOld, event: 'ApplyFilter', argNames: ['Cancel', 'ApplyType'], handler: (this: Access.FormOld, parameter: {Cancel: number, ApplyType: number}) => void): void; - on( - obj: Access.FormOld, event: 'BeforeBeginTransaction' | 'BeforeCommitTransaction', argNames: ['Cancel', 'Connection'], handler: ( - this: Access.FormOld, parameter: {Cancel: number, readonly Connection: ADODB.Connection}) => void): void; - on(obj: Access.FormOld, event: 'BeforeDelConfirm', argNames: ['Cancel', 'Response'], handler: (this: Access.FormOld, parameter: {Cancel: number, Response: number}) => void): void; - on( - obj: Access.FormOld, event: 'BeforeInsert' | 'BeforeUpdate' | 'BeginBatchEdit' | 'DblClick' | 'Delete' | 'Dirty' | 'Open' | 'RecordExit' | 'Undo' | - 'UndoBatchEdit' | 'Unload', - argNames: ['Cancel'], handler: (this: Access.FormOld, parameter: {Cancel: number}) => void): void; - on( - obj: Access.FormOld, event: 'BeforeRender', argNames: ['drawObject', 'chartObject', 'Cancel'], handler: ( - this: Access.FormOld, parameter: {readonly drawObject: any, readonly chartObject: any, readonly Cancel: any}) => void): void; - on( - obj: Access.FormOld, event: 'BeforeScreenTip', argNames: ['ScreenTipText', 'SourceObject'], handler: ( - this: Access.FormOld, parameter: {readonly ScreenTipText: any, readonly SourceObject: any}) => void): void; - on(obj: Access.FormOld, event: 'CommandBeforeExecute', argNames: ['Command', 'Cancel'], handler: (this: Access.FormOld, parameter: {readonly Command: any, readonly Cancel: any}) => void): void; - on(obj: Access.FormOld, event: 'CommandChecked', argNames: ['Command', 'Checked'], handler: (this: Access.FormOld, parameter: {readonly Command: any, readonly Checked: any}) => void): void; - on(obj: Access.FormOld, event: 'CommandEnabled', argNames: ['Command', 'Enabled'], handler: (this: Access.FormOld, parameter: {readonly Command: any, readonly Enabled: any}) => void): void; - on(obj: Access.FormOld, event: 'CommandExecute', argNames: ['Command'], handler: (this: Access.FormOld, parameter: {readonly Command: any}) => void): void; - on(obj: Access.FormOld, event: 'DataChange' | 'PivotTableChange' | 'ViewChange', argNames: ['Reason'], handler: (this: Access.FormOld, parameter: {readonly Reason: number}) => void): void; - on(obj: Access.FormOld, event: 'Error', argNames: ['DataErr', 'Response'], handler: (this: Access.FormOld, parameter: {DataErr: number, Response: number}) => void): void; - on(obj: Access.FormOld, event: 'Filter', argNames: ['Cancel', 'FilterType'], handler: (this: Access.FormOld, parameter: {Cancel: number, FilterType: number}) => void): void; - on(obj: Access.FormOld, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: Access.FormOld, parameter: {KeyCode: number, Shift: number}) => void): void; - on(obj: Access.FormOld, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: Access.FormOld, parameter: {KeyAscii: number}) => void): void; - on( - obj: Access.FormOld, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.FormOld, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; - on(obj: Access.FormOld, event: 'MouseWheel', argNames: ['Page', 'Count'], handler: (this: Access.FormOld, parameter: {readonly Page: boolean, readonly Count: number}) => void): void; - on( - obj: Access.FormOldV10, event: 'AfterBeginTransaction' | 'AfterCommitTransaction' | 'RollbackTransaction', argNames: ['Connection'], - handler: (this: Access.FormOldV10, parameter: {readonly Connection: ADODB.Connection}) => void): void; - on(obj: Access.FormOldV10, event: 'AfterDelConfirm', argNames: ['Status'], handler: (this: Access.FormOldV10, parameter: {Status: number}) => void): void; - on(obj: Access.FormOldV10, event: 'AfterFinalRender' | 'AfterLayout', argNames: ['drawObject'], handler: (this: Access.FormOldV10, parameter: {readonly drawObject: any}) => void): void; - on( - obj: Access.FormOldV10, event: 'AfterRender', argNames: ['drawObject', 'chartObject'], handler: ( - this: Access.FormOldV10, parameter: {readonly drawObject: any, readonly chartObject: any}) => void): void; - on(obj: Access.FormOldV10, event: 'ApplyFilter', argNames: ['Cancel', 'ApplyType'], handler: (this: Access.FormOldV10, parameter: {Cancel: number, ApplyType: number}) => void): void; - on( - obj: Access.FormOldV10, event: 'BeforeBeginTransaction' | 'BeforeCommitTransaction', argNames: ['Cancel', 'Connection'], handler: ( - this: Access.FormOldV10, parameter: {Cancel: number, readonly Connection: ADODB.Connection}) => void): void; - on(obj: Access.FormOldV10, event: 'BeforeDelConfirm', argNames: ['Cancel', 'Response'], handler: (this: Access.FormOldV10, parameter: {Cancel: number, Response: number}) => void): void; - on( - obj: Access.FormOldV10, event: 'BeforeInsert' | 'BeforeUpdate' | 'BeginBatchEdit' | 'DblClick' | 'Delete' | 'Dirty' | 'Open' | 'RecordExit' | 'Undo' | - 'UndoBatchEdit' | 'Unload', - argNames: ['Cancel'], handler: (this: Access.FormOldV10, parameter: {Cancel: number}) => void): void; - on( - obj: Access.FormOldV10, event: 'BeforeRender', argNames: ['drawObject', 'chartObject', 'Cancel'], handler: ( - this: Access.FormOldV10, parameter: {readonly drawObject: any, readonly chartObject: any, readonly Cancel: any}) => void): void; - on( - obj: Access.FormOldV10, event: 'BeforeScreenTip', argNames: ['ScreenTipText', 'SourceObject'], handler: ( - this: Access.FormOldV10, parameter: {readonly ScreenTipText: any, readonly SourceObject: any}) => void): void; - on( - obj: Access.FormOldV10, event: 'CommandBeforeExecute', argNames: ['Command', 'Cancel'], handler: ( - this: Access.FormOldV10, parameter: {readonly Command: any, readonly Cancel: any}) => void): void; - on(obj: Access.FormOldV10, event: 'CommandChecked', argNames: ['Command', 'Checked'], handler: (this: Access.FormOldV10, parameter: {readonly Command: any, readonly Checked: any}) => void): void; - on(obj: Access.FormOldV10, event: 'CommandEnabled', argNames: ['Command', 'Enabled'], handler: (this: Access.FormOldV10, parameter: {readonly Command: any, readonly Enabled: any}) => void): void; - on(obj: Access.FormOldV10, event: 'CommandExecute', argNames: ['Command'], handler: (this: Access.FormOldV10, parameter: {readonly Command: any}) => void): void; - on(obj: Access.FormOldV10, event: 'DataChange' | 'PivotTableChange' | 'ViewChange', argNames: ['Reason'], handler: (this: Access.FormOldV10, parameter: {readonly Reason: number}) => void): void; - on(obj: Access.FormOldV10, event: 'Error', argNames: ['DataErr', 'Response'], handler: (this: Access.FormOldV10, parameter: {DataErr: number, Response: number}) => void): void; - on(obj: Access.FormOldV10, event: 'Filter', argNames: ['Cancel', 'FilterType'], handler: (this: Access.FormOldV10, parameter: {Cancel: number, FilterType: number}) => void): void; - on(obj: Access.FormOldV10, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: Access.FormOldV10, parameter: {KeyCode: number, Shift: number}) => void): void; - on(obj: Access.FormOldV10, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: Access.FormOldV10, parameter: {KeyAscii: number}) => void): void; - on( - obj: Access.FormOldV10, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.FormOldV10, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; - on(obj: Access.FormOldV10, event: 'MouseWheel', argNames: ['Page', 'Count'], handler: (this: Access.FormOldV10, parameter: {readonly Page: boolean, readonly Count: number}) => void): void; on(obj: Access.Image, event: 'DblClick', argNames: ['Cancel'], handler: (this: Access.Image, parameter: {Cancel: number}) => void): void; - on( - obj: Access.Image, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.Image, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access.Image, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access.Image, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access.Label, event: 'DblClick', argNames: ['Cancel'], handler: (this: Access.Label, parameter: {Cancel: number}) => void): void; - on( - obj: Access.Label, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.Label, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access.Label, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access.Label, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access.ListBox, event: 'BeforeUpdate' | 'DblClick' | 'Exit', argNames: ['Cancel'], handler: (this: Access.ListBox, parameter: {Cancel: number}) => void): void; on(obj: Access.ListBox, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: Access.ListBox, parameter: {KeyCode: number, Shift: number}) => void): void; on(obj: Access.ListBox, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: Access.ListBox, parameter: {KeyAscii: number}) => void): void; - on( - obj: Access.ListBox, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.ListBox, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access.ListBox, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access.ListBox, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access.NavigationButton, event: 'DblClick' | 'Exit', argNames: ['Cancel'], handler: (this: Access.NavigationButton, parameter: {Cancel: number}) => void): void; on(obj: Access.NavigationButton, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: Access.NavigationButton, parameter: {KeyCode: number, Shift: number}) => void): void; on(obj: Access.NavigationButton, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: Access.NavigationButton, parameter: {KeyAscii: number}) => void): void; - on( - obj: Access.NavigationButton, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.NavigationButton, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; - on( - obj: Access.NavigationControl, event: 'BeforeUpdate' | 'DblClick' | 'Dirty' | 'Exit' | 'Undo', argNames: ['Cancel'], handler: ( - this: Access.NavigationControl, parameter: {Cancel: number}) => void): void; + on(obj: Access.NavigationButton, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access.NavigationButton, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access.NavigationControl, event: 'BeforeUpdate' | 'DblClick' | 'Dirty' | 'Exit' | 'Undo', argNames: ['Cancel'], handler: (this: Access.NavigationControl, parameter: {Cancel: number}) => void): void; on(obj: Access.NavigationControl, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: Access.NavigationControl, parameter: {KeyCode: number, Shift: number}) => void): void; on(obj: Access.NavigationControl, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: Access.NavigationControl, parameter: {KeyAscii: number}) => void): void; - on( - obj: Access.NavigationControl, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.NavigationControl, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access.NavigationControl, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access.NavigationControl, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access.ObjectFrame, event: 'DblClick' | 'Exit', argNames: ['Cancel'], handler: (this: Access.ObjectFrame, parameter: {Cancel: number}) => void): void; - on( - obj: Access.ObjectFrame, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.ObjectFrame, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access.ObjectFrame, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access.ObjectFrame, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access.ObjectFrame, event: 'Updated', argNames: ['Code'], handler: (this: Access.ObjectFrame, parameter: {Code: number}) => void): void; on(obj: Access.OptionButton, event: 'BeforeUpdate' | 'DblClick' | 'Exit', argNames: ['Cancel'], handler: (this: Access.OptionButton, parameter: {Cancel: number}) => void): void; on(obj: Access.OptionButton, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: Access.OptionButton, parameter: {KeyCode: number, Shift: number}) => void): void; on(obj: Access.OptionButton, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: Access.OptionButton, parameter: {KeyAscii: number}) => void): void; - on( - obj: Access.OptionButton, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.OptionButton, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access.OptionButton, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access.OptionButton, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access.OptionGroup, event: 'BeforeUpdate' | 'DblClick' | 'Exit', argNames: ['Cancel'], handler: (this: Access.OptionGroup, parameter: {Cancel: number}) => void): void; - on( - obj: Access.OptionGroup, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.OptionGroup, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access.OptionGroup, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access.OptionGroup, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access.Page, event: 'DblClick', argNames: ['Cancel'], handler: (this: Access.Page, parameter: {Cancel: number}) => void): void; - on( - obj: Access.Page, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.Page, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access.Page, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access.Page, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access.PaletteButton, event: 'BeforeUpdate' | 'DblClick' | 'Exit', argNames: ['Cancel'], handler: (this: Access.PaletteButton, parameter: {Cancel: number}) => void): void; on(obj: Access.PaletteButton, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: Access.PaletteButton, parameter: {KeyCode: number, Shift: number}) => void): void; on(obj: Access.PaletteButton, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: Access.PaletteButton, parameter: {KeyAscii: number}) => void): void; - on( - obj: Access.PaletteButton, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.PaletteButton, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access.PaletteButton, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access.PaletteButton, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access.Rectangle, event: 'DblClick', argNames: ['Cancel'], handler: (this: Access.Rectangle, parameter: {Cancel: number}) => void): void; - on( - obj: Access.Rectangle, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.Rectangle, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access.Rectangle, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access.Rectangle, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access.References, event: 'ItemAdded' | 'ItemRemoved', argNames: ['Reference'], handler: (this: Access.References, parameter: {readonly Reference: Access.Reference}) => void): void; on(obj: Access.Report, event: 'ApplyFilter', argNames: ['Cancel', 'ApplyType'], handler: (this: Access.Report, parameter: {Cancel: number, ApplyType: number}) => void): void; on(obj: Access.Report, event: 'DblClick' | 'NoData' | 'Open' | 'Unload', argNames: ['Cancel'], handler: (this: Access.Report, parameter: {Cancel: number}) => void): void; @@ -8775,58 +8128,32 @@ interface ActiveXObject { on(obj: Access.Report, event: 'Filter', argNames: ['Cancel', 'FilterType'], handler: (this: Access.Report, parameter: {Cancel: number, FilterType: number}) => void): void; on(obj: Access.Report, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: Access.Report, parameter: {KeyCode: number, Shift: number}) => void): void; on(obj: Access.Report, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: Access.Report, parameter: {KeyAscii: number}) => void): void; - on( - obj: Access.Report, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.Report, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access.Report, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access.Report, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access.Report, event: 'MouseWheel', argNames: ['Page', 'Count'], handler: (this: Access.Report, parameter: {readonly Page: boolean, readonly Count: number}) => void): void; - on(obj: Access.ReportOld, event: 'Error', argNames: ['DataErr', 'Response'], handler: (this: Access.ReportOld, parameter: {DataErr: number, Response: number}) => void): void; - on(obj: Access.ReportOld, event: 'NoData' | 'Open', argNames: ['Cancel'], handler: (this: Access.ReportOld, parameter: {Cancel: number}) => void): void; - on(obj: Access.ReportOldV10, event: 'Error', argNames: ['DataErr', 'Response'], handler: (this: Access.ReportOldV10, parameter: {DataErr: number, Response: number}) => void): void; - on(obj: Access.ReportOldV10, event: 'NoData' | 'Open', argNames: ['Cancel'], handler: (this: Access.ReportOldV10, parameter: {Cancel: number}) => void): void; on(obj: Access.Section, event: 'DblClick', argNames: ['Cancel'], handler: (this: Access.Section, parameter: {Cancel: number}) => void): void; - on( - obj: Access.Section, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.Section, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access.Section, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access.Section, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access.SubForm, event: 'Exit', argNames: ['Cancel'], handler: (this: Access.SubForm, parameter: {Cancel: number}) => void): void; on(obj: Access.SubReport, event: 'Exit', argNames: ['Cancel'], handler: (this: Access.SubReport, parameter: {Cancel: number}) => void): void; on(obj: Access.TabControl, event: 'DblClick', argNames: ['Cancel'], handler: (this: Access.TabControl, parameter: {Cancel: number}) => void): void; on(obj: Access.TabControl, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: Access.TabControl, parameter: {KeyCode: number, Shift: number}) => void): void; on(obj: Access.TabControl, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: Access.TabControl, parameter: {KeyAscii: number}) => void): void; - on( - obj: Access.TabControl, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.TabControl, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access.TabControl, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access.TabControl, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access.TextBox, event: 'BeforeUpdate' | 'DblClick' | 'Dirty' | 'Exit' | 'Undo', argNames: ['Cancel'], handler: (this: Access.TextBox, parameter: {Cancel: number}) => void): void; on(obj: Access.TextBox, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: Access.TextBox, parameter: {KeyCode: number, Shift: number}) => void): void; on(obj: Access.TextBox, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: Access.TextBox, parameter: {KeyAscii: number}) => void): void; - on( - obj: Access.TextBox, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.TextBox, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access.TextBox, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access.TextBox, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; on(obj: Access.ToggleButton, event: 'BeforeUpdate' | 'DblClick' | 'Exit', argNames: ['Cancel'], handler: (this: Access.ToggleButton, parameter: {Cancel: number}) => void): void; on(obj: Access.ToggleButton, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: Access.ToggleButton, parameter: {KeyCode: number, Shift: number}) => void): void; on(obj: Access.ToggleButton, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: Access.ToggleButton, parameter: {KeyAscii: number}) => void): void; - on( - obj: Access.ToggleButton, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.ToggleButton, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; - on( - obj: Access.WebBrowserControl, event: 'BeforeNavigate2', argNames: Access.EventHelperTypes.WebBrowserControl_BeforeNavigate2_ArgNames, - handler: (this: Access.WebBrowserControl, parameter: Access.EventHelperTypes.WebBrowserControl_BeforeNavigate2_Parameter) => void): void; - on( - obj: Access.WebBrowserControl, event: 'BeforeUpdate' | 'DblClick' | 'Dirty' | 'Exit', argNames: ['Cancel'], handler: ( - this: Access.WebBrowserControl, parameter: {Cancel: number}) => void): void; - on( - obj: Access.WebBrowserControl, event: 'DocumentComplete', argNames: ['pDisp', 'URL'], handler: ( - this: Access.WebBrowserControl, parameter: {readonly pDisp: any, readonly URL: any}) => void): void; + on(obj: Access.ToggleButton, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access.ToggleButton, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access.WebBrowserControl, event: 'BeforeNavigate2', argNames: Access.EventHelperTypes.WebBrowserControl_BeforeNavigate2_ArgNames, handler: (this: Access.WebBrowserControl, parameter: Access.EventHelperTypes.WebBrowserControl_BeforeNavigate2_Parameter) => void): void; + on(obj: Access.WebBrowserControl, event: 'BeforeUpdate' | 'DblClick' | 'Dirty' | 'Exit', argNames: ['Cancel'], handler: (this: Access.WebBrowserControl, parameter: {Cancel: number}) => void): void; + on(obj: Access.WebBrowserControl, event: 'DocumentComplete', argNames: ['pDisp', 'URL'], handler: (this: Access.WebBrowserControl, parameter: {readonly pDisp: any, readonly URL: any}) => void): void; on(obj: Access.WebBrowserControl, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: Access.WebBrowserControl, parameter: {KeyCode: number, Shift: number}) => void): void; on(obj: Access.WebBrowserControl, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: Access.WebBrowserControl, parameter: {KeyAscii: number}) => void): void; - on( - obj: Access.WebBrowserControl, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: Access.WebBrowserControl, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; - on( - obj: Access.WebBrowserControl, event: 'NavigateError', argNames: ['pDisp', 'URL', 'TargetFrameName', 'StatusCode', 'Cancel'], - handler: (this: Access.WebBrowserControl, parameter: {readonly pDisp: any, readonly URL: any, readonly TargetFrameName: any, readonly StatusCode: any, Cancel: boolean}) => void): void; - on( - obj: Access.WebBrowserControl, event: 'ProgressChange', argNames: ['Progress', 'ProgressMax'], handler: ( - this: Access.WebBrowserControl, parameter: {readonly Progress: number, readonly ProgressMax: number}) => void): void; + on(obj: Access.WebBrowserControl, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: Access.WebBrowserControl, parameter: {Button: number, Shift: number, X: number, Y: number}) => void): void; + on(obj: Access.WebBrowserControl, event: 'NavigateError', argNames: ['pDisp', 'URL', 'TargetFrameName', 'StatusCode', 'Cancel'], handler: (this: Access.WebBrowserControl, parameter: {readonly pDisp: any, readonly URL: string, readonly TargetFrameName: string | null, readonly StatusCode: any, Cancel: boolean}) => void): void; + on(obj: Access.WebBrowserControl, event: 'ProgressChange', argNames: ['Progress', 'ProgressMax'], handler: (this: Access.WebBrowserControl, parameter: {readonly Progress: number, readonly ProgressMax: number}) => void): void; on(obj: Access.WebBrowserControl, event: 'Updated', argNames: ['Code'], handler: (this: Access.WebBrowserControl, parameter: {Code: number}) => void): void; on(obj: Access._CheckBoxInOption, event: 'AfterUpdate' | 'Click' | 'Enter' | 'GotFocus' | 'LostFocus', handler: (this: Access._CheckBoxInOption, parameter: {}) => void): void; on(obj: Access._OptionButtonInOption, event: 'AfterUpdate' | 'Click' | 'Enter' | 'GotFocus' | 'LostFocus', handler: (this: Access._OptionButtonInOption, parameter: {}) => void): void; @@ -8840,18 +8167,7 @@ interface ActiveXObject { on(obj: Access.ComboBox, event: 'AfterUpdate' | 'Change' | 'Click' | 'Enter' | 'GotFocus' | 'LostFocus', handler: (this: Access.ComboBox, parameter: {}) => void): void; on(obj: Access.CommandButton, event: 'Click' | 'Enter' | 'GotFocus' | 'LostFocus', handler: (this: Access.CommandButton, parameter: {}) => void): void; on(obj: Access.CustomControl, event: 'Enter' | 'GotFocus' | 'LostFocus', handler: (this: Access.CustomControl, parameter: {}) => void): void; - on( - obj: Access.Form, event: 'Activate' | 'AfterInsert' | 'AfterUpdate' | 'BeforeQuery' | 'Click' | 'Close' | 'Current' | 'DataSetChange' | 'Deactivate' | 'GotFocus' | - 'Load' | 'LostFocus' | 'OnConnect' | 'OnDisconnect' | 'Query' | 'Resize' | 'SelectionChange' | 'Timer', - handler: (this: Access.Form, parameter: {}) => void): void; - on( - obj: Access.FormOld, event: 'Activate' | 'AfterInsert' | 'AfterUpdate' | 'BeforeQuery' | 'Click' | 'Close' | 'Current' | 'DataSetChange' | 'Deactivate' | - 'GotFocus' | 'Load' | 'LostFocus' | 'OnConnect' | 'OnDisconnect' | 'Query' | 'Resize' | 'SelectionChange' | 'Timer', - handler: (this: Access.FormOld, parameter: {}) => void): void; - on( - obj: Access.FormOldV10, event: 'Activate' | 'AfterInsert' | 'AfterUpdate' | 'BeforeQuery' | 'Click' | 'Close' | 'Current' | 'DataSetChange' | 'Deactivate' | - 'GotFocus' | 'Load' | 'LostFocus' | 'OnConnect' | 'OnDisconnect' | 'Query' | 'Resize' | 'SelectionChange' | 'Timer', - handler: (this: Access.FormOldV10, parameter: {}) => void): void; + on(obj: Access.Form, event: 'Activate' | 'AfterInsert' | 'AfterUpdate' | 'BeforeQuery' | 'Click' | 'Close' | 'Current' | 'DataSetChange' | 'Deactivate' | 'GotFocus' | 'Load' | 'LostFocus' | 'OnConnect' | 'OnDisconnect' | 'Query' | 'Resize' | 'SelectionChange' | 'Timer', handler: (this: Access.Form, parameter: {}) => void): void; on(obj: Access.Image, event: 'Click', handler: (this: Access.Image, parameter: {}) => void): void; on(obj: Access.Label, event: 'Click', handler: (this: Access.Label, parameter: {}) => void): void; on(obj: Access.ListBox, event: 'AfterUpdate' | 'Click' | 'Enter' | 'GotFocus' | 'LostFocus', handler: (this: Access.ListBox, parameter: {}) => void): void; @@ -8863,11 +8179,7 @@ interface ActiveXObject { on(obj: Access.Page, event: 'Click', handler: (this: Access.Page, parameter: {}) => void): void; on(obj: Access.PaletteButton, event: 'AfterUpdate' | 'Click' | 'Enter' | 'GotFocus' | 'LostFocus', handler: (this: Access.PaletteButton, parameter: {}) => void): void; on(obj: Access.Rectangle, event: 'Click', handler: (this: Access.Rectangle, parameter: {}) => void): void; - on( - obj: Access.Report, event: 'Activate' | 'Click' | 'Close' | 'Current' | 'Deactivate' | 'GotFocus' | 'Load' | 'LostFocus' | 'Page' | 'Resize' | 'Timer', - handler: (this: Access.Report, parameter: {}) => void): void; - on(obj: Access.ReportOld, event: 'Activate' | 'Close' | 'Deactivate' | 'Page', handler: (this: Access.ReportOld, parameter: {}) => void): void; - on(obj: Access.ReportOldV10, event: 'Activate' | 'Close' | 'Deactivate' | 'Page', handler: (this: Access.ReportOldV10, parameter: {}) => void): void; + on(obj: Access.Report, event: 'Activate' | 'Click' | 'Close' | 'Current' | 'Deactivate' | 'GotFocus' | 'Load' | 'LostFocus' | 'Page' | 'Resize' | 'Timer', handler: (this: Access.Report, parameter: {}) => void): void; on(obj: Access.Section, event: 'Click' | 'Paint', handler: (this: Access.Section, parameter: {}) => void): void; on(obj: Access.SubForm, event: 'Enter', handler: (this: Access.SubForm, parameter: {}) => void): void; on(obj: Access.SubReport, event: 'Enter', handler: (this: Access.SubReport, parameter: {}) => void): void; @@ -8875,51 +8187,26 @@ interface ActiveXObject { on(obj: Access.TextBox, event: 'AfterUpdate' | 'Change' | 'Click' | 'Enter' | 'GotFocus' | 'LostFocus', handler: (this: Access.TextBox, parameter: {}) => void): void; on(obj: Access.ToggleButton, event: 'AfterUpdate' | 'Click' | 'Enter' | 'GotFocus' | 'LostFocus', handler: (this: Access.ToggleButton, parameter: {}) => void): void; on(obj: Access.WebBrowserControl, event: 'AfterUpdate' | 'Change' | 'Click' | 'Enter' | 'GotFocus' | 'LostFocus', handler: (this: Access.WebBrowserControl, parameter: {}) => void): void; - set( - obj: Access._CheckBoxInOption | Access._ChildLabel | Access._CustomControlInReport | Access._OptionButtonInOption | Access._ToggleButtonInOption | - Access.Attachment | Access.BoundObjectFrame | Access.CheckBox | Access.ComboBox | Access.CommandButton | Access.CustomControl | Access.EmptyCell | Access.Form | - Access.FormOld | Access.FormOldV10 | Access.Label | Access.ListBox | Access.NavigationButton | Access.NavigationControl | Access.ObjectFrame | - Access.OptionButton | Access.OptionGroup | Access.Page | Access.SubForm | Access.TabControl | Access.TextBox | Access.ToggleButton | Access.WebBrowserControl, - propertyName: 'accName' | 'accValue', parameterTypes: [any], newValue: string): void; + on(obj: AccWizObjects.FieldList, event: 'DragDrop', argNames: ['SourceCtlName', 'SourceFieldList', 'SourceRow', 'X', 'Y'], handler: (this: AccWizObjects.FieldList, parameter: { readonly SourceCtlName: string, readonly SourceFieldList: number, readonly SourceRow: number, readonly X: number, readonly Y: number }) => void): void; + on(obj: AccWizObjects.FieldList, event: 'DragOver', argNames: AccWizObjects.EventHelperTypes.FieldList_DragOver_ArgNames, handler: (this: AccWizObjects.FieldList, parameter: AccWizObjects.EventHelperTypes.FieldList_DragOver_Parameter) => void): void; + on(obj: AccWizObjects.FieldList, event: 'FldListCheckItem' | 'FldListClick' | 'FldListDblClick' | 'FldListHdrDblClick', argNames: ['FieldList'], handler: (this: AccWizObjects.FieldList, parameter: { readonly FieldList: number }) => void): void; + on(obj: AccWizObjects.FieldList, event: 'FldListDragDrop', argNames: AccWizObjects.EventHelperTypes.FieldList_FldListDragDrop_ArgNames, handler: (this: AccWizObjects.FieldList, parameter: AccWizObjects.EventHelperTypes.FieldList_FldListDragDrop_Parameter) => void): void; + on(obj: AccWizObjects.FieldList, event: 'FldListDragOver', argNames: AccWizObjects.EventHelperTypes.FieldList_FldListDragOver_ArgNames, handler: (this: AccWizObjects.FieldList, parameter: AccWizObjects.EventHelperTypes.FieldList_FldListDragOver_Parameter) => void): void; + on(obj: AccWizObjects.FieldList, event: 'FldListGotFocus' | 'FldListLostFocus', argNames: ['FieldListIndex'], handler: (this: AccWizObjects.FieldList, parameter: { readonly FieldListIndex: number }) => void): void; + on(obj: AccWizObjects.FieldList, event: 'FldListKeyDown' | 'FldListKeyUp', argNames: ['FieldList', 'KeyCode', 'Shift'], handler: (this: AccWizObjects.FieldList, parameter: { readonly FieldList: number, KeyCode: number, readonly Shift: number }) => void): void; + on(obj: AccWizObjects.FieldList, event: 'FldListKeyPress', argNames: ['FieldList', 'KeyAscii'], handler: (this: AccWizObjects.FieldList, parameter: { readonly FieldList: number, KeyAscii: number }) => void): void; + on(obj: AccWizObjects.FieldList, event: 'FldListMouseDown' | 'FldListMouseMove' | 'FldListMouseUp', argNames: ['FieldList', 'Button', 'Shift', 'X', 'Y'], handler: (this: AccWizObjects.FieldList, parameter: { readonly FieldList: number, readonly Button: number, readonly Shift: number, readonly X: stdole.OLE_XPOS_PIXELS, readonly Y: stdole.OLE_YPOS_PIXELS }) => void): void; + on(obj: AccWizObjects.ImexGrid, event: 'ColumnCreated' | 'ColumnDeleted' | 'ColumnSelected' | 'ColumnSized', argNames: ['Column'], handler: (this: AccWizObjects.ImexGrid, parameter: { readonly Column: number }) => void): void; + on(obj: AccWizObjects.FieldList, event: 'AfterStartup', handler: (this: AccWizObjects.FieldList, parameter: {}) => void): void; + set(obj: Access._CheckBoxInOption | Access._ChildLabel | Access._CustomControlInReport | Access._OptionButtonInOption | Access._ToggleButtonInOption | Access.Attachment | Access.BoundObjectFrame | Access.CheckBox | Access.ComboBox | Access.CommandButton | Access.CustomControl | Access.EmptyCell | Access.Form | Access.Label | Access.ListBox | Access.NavigationButton | Access.NavigationControl | Access.ObjectFrame | Access.OptionButton | Access.OptionGroup | Access.Page | Access.SubForm | Access.TabControl | Access.TextBox | Access.ToggleButton | Access.WebBrowserControl, propertyName: 'accName' | 'accValue', parameterTypes: [any], newValue: string): void; set(obj: Access._ControlInReportEvents | Access.ComboBox | Access.Control | Access.ListBox, propertyName: 'Selected', parameterTypes: [number], newValue: number): void; - new(progid: K): ActiveXObjectNameMap[K]; + set(obj: AccWizObjects.ImexGrid, propertyName: 'Columns', parameterTypes: [number], newValue: any): void; + set(obj: AccWizObjects.ImexGrid, propertyName: 'RowText', parameterTypes: [number], newValue: string): void; } interface ActiveXObjectNameMap { 'Access.Application': Access.Application; -} - -interface EnumeratorConstructor { - new(col: Access._ItemsSelected): Enumerator; - new(col: Access.AccessObjectProperties): Enumerator; - new(col: Access.AdditionalData): Enumerator; - new( - col: Access.AllDataAccessPages | Access.AllDatabaseDiagrams | Access.AllForms | Access.AllFunctions | Access.AllMacros | Access.AllModules | Access.AllQueries | - Access.AllReports | Access.AllStoredProcedures | Access.AllTables | Access.AllViews | Access.DependencyObjects): Enumerator; - new(col: Access.Controls): Enumerator; - new(col: Access.Children | Access.Properties): Enumerator; // tslint:disable-line:use-default-type-parameter - new(col: Access.DataAccessPages): Enumerator; - new(col: Access.Entities): Enumerator; - new(col: Access.FormatConditions): Enumerator; - new(col: Access.Forms): Enumerator; - new(col: Access.ImportExportSpecifications): Enumerator; - new(col: Access.LocalVars): Enumerator; - new(col: Access.Modules): Enumerator; - new(col: Access.Operations): Enumerator; - new(col: Access.Pages): Enumerator; - new(col: Access.Printers): Enumerator; - new(col: Access.References): Enumerator; - new(col: Access.Reports): Enumerator; - new(col: Access.ReturnVars): Enumerator; - new(col: Access.SharedResources): Enumerator; - new(col: Access.SmartTagActions): Enumerator; - new(col: Access.SmartTagProperties): Enumerator; - new(col: Access.SmartTags): Enumerator; - new(col: Access.TempVars): Enumerator; - new(col: Access.WebServices): Enumerator; - new(col: Access.WSParameters): Enumerator; -} - -interface SafeArray { - _brand: SafeArray; + 'ACCWIZ.FieldListCtrl': AccWizObjects.FieldList; + 'ACCWIZ.ImexGridCtrl': AccWizObjects.ImexGrid; + lnkfile: AccWizObjects.WizShellLinkA; } diff --git a/types/activex-access/tsconfig.json b/types/activex-access/tsconfig.json index a376fcb722..867c1e2970 100644 --- a/types/activex-access/tsconfig.json +++ b/types/activex-access/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5", - "scripthost" + "es5" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/activex-access/tslint.json b/types/activex-access/tslint.json index 3224b40b8b..7b89accc6d 100644 --- a/types/activex-access/tslint.json +++ b/types/activex-access/tslint.json @@ -1,6 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "no-const-enum": false + "no-const-enum": false, + "max-line-length": false } } diff --git a/types/activex-adodb/activex-adodb-tests.ts b/types/activex-adodb/activex-adodb-tests.ts index 347e1d9c9f..eecc7e9bdc 100644 --- a/types/activex-adodb/activex-adodb-tests.ts +++ b/types/activex-adodb/activex-adodb-tests.ts @@ -1,5 +1,8 @@ // Note -- running these tests under cscript requires some ES5 polyfills +/// +/// + const collectionToArray = (col: { Item(key: any): T }): T[] => { const results: T[] = []; const enumerator = new Enumerator(col); @@ -12,9 +15,9 @@ const collectionToArray = (col: { Item(key: any): T }): T[] => { }; const toSafeArray = (...items: T[]): SafeArray => { - const dict = new ActiveXObject('Scripting.Dictionary'); + const dict: Scripting.Dictionary = new ActiveXObject('Scripting.Dictionary'); items.forEach((x, index) => dict.Add(index, x)); - return dict.Items() as SafeArray; + return dict.Items(); }; const toConnectionString = (o: { [index: string]: any }) => { diff --git a/types/activex-adodb/index.d.ts b/types/activex-adodb/index.d.ts index 1879891b2d..580042cfa6 100644 --- a/types/activex-adodb/index.d.ts +++ b/types/activex-adodb/index.d.ts @@ -4,6 +4,8 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 +/// + declare namespace ADODB { const enum ADCPROP_ASYNCTHREADPRIORITY_ENUM { adPriorityAboveNormal = 4, @@ -1094,7 +1096,6 @@ declare namespace ADODB { } interface ActiveXObject { - new(progid: K): ActiveXObjectNameMap[K]; on(obj: ADODB.Connection, event: 'BeginTransComplete', argNames: ['TransactionLevel', 'pError', 'adStatus', 'pConnection'], handler: (this: ADODB.Connection, parameter: {readonly TransactionLevel: number, readonly pError: ADODB.Error, adStatus: ADODB.EventStatusEnum, readonly pConnection: ADODB.Connection}) => void): void; on(obj: ADODB.Connection, event: 'CommitTransComplete' | 'ConnectComplete' | 'InfoMessage' | 'RollbackTransComplete', argNames: ['pError', 'adStatus', 'pConnection'], handler: (this: ADODB.Connection, parameter: {readonly pError: ADODB.Error, adStatus: ADODB.EventStatusEnum, readonly pConnection: ADODB.Connection}) => void): void; on(obj: ADODB.Connection, event: 'Disconnect', argNames: ['adStatus', 'pConnection'], handler: (this: ADODB.Connection, parameter: {adStatus: ADODB.EventStatusEnum, readonly pConnection: ADODB.Connection}) => void): void; diff --git a/types/activex-adodb/tsconfig.json b/types/activex-adodb/tsconfig.json index 5cb32f94c9..abf5b79a00 100644 --- a/types/activex-adodb/tsconfig.json +++ b/types/activex-adodb/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5", - "scripthost" + "es5" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/activex-adox/activex-adox-tests.ts b/types/activex-adox/activex-adox-tests.ts index 1b6ec21d1f..df5c75ef12 100644 --- a/types/activex-adox/activex-adox-tests.ts +++ b/types/activex-adox/activex-adox-tests.ts @@ -1,3 +1,5 @@ +/// + const collectionToArray = (col: { Item(key: any): T }): T[] => { const results: T[] = []; const enumerator = new Enumerator(col); diff --git a/types/activex-adox/index.d.ts b/types/activex-adox/index.d.ts index 8960dd0a31..fd502684e4 100644 --- a/types/activex-adox/index.d.ts +++ b/types/activex-adox/index.d.ts @@ -4,6 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 +/// /// declare namespace ADOX { @@ -320,10 +321,6 @@ declare namespace ADOX { } } -interface ActiveXObject { - new(progid: K): ActiveXObjectNameMap[K]; -} - interface ActiveXObjectNameMap { 'ADOX.Catalog': ADOX.Catalog; 'ADOX.Column': ADOX.Column; diff --git a/types/activex-adox/tsconfig.json b/types/activex-adox/tsconfig.json index 7aaa955db5..30b6288e6a 100644 --- a/types/activex-adox/tsconfig.json +++ b/types/activex-adox/tsconfig.json @@ -1,8 +1,9 @@ - { "compilerOptions": { "module": "commonjs", - "lib": ["es5", "scripthost"], + "lib": [ + "es5" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, diff --git a/types/activex-dao/activex-dao-tests.ts b/types/activex-dao/activex-dao-tests.ts index 7e8c2bef22..6eea19f8e6 100644 --- a/types/activex-dao/activex-dao-tests.ts +++ b/types/activex-dao/activex-dao-tests.ts @@ -1,3 +1,5 @@ +/// + const collectionToArray = (col: { Item(key: any): T }): T[] => { const results: T[] = []; const enumerator = new Enumerator(col); diff --git a/types/activex-dao/index.d.ts b/types/activex-dao/index.d.ts index a2a159e324..0a13747514 100644 --- a/types/activex-dao/index.d.ts +++ b/types/activex-dao/index.d.ts @@ -4,6 +4,8 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 +/// + declare namespace DAO { const enum _DAOSuppHelp { KeepLocal = 0, @@ -883,10 +885,6 @@ declare namespace DAO { } } -interface ActiveXObject { - new(progid: K): ActiveXObjectNameMap[K]; -} - interface ActiveXObjectNameMap { 'DAO.DBEngine': DAO.DBEngine; 'DAO.Field': DAO.Field; diff --git a/types/activex-dao/tsconfig.json b/types/activex-dao/tsconfig.json index 2ddea247b9..e9d00e61e1 100644 --- a/types/activex-dao/tsconfig.json +++ b/types/activex-dao/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5", - "scripthost" + "es5" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/activex-diskquota/index.d.ts b/types/activex-diskquota/index.d.ts index d27863de3c..71b534ee0c 100644 --- a/types/activex-diskquota/index.d.ts +++ b/types/activex-diskquota/index.d.ts @@ -2,7 +2,9 @@ // Project: https://msdn.microsoft.com/en-us/library/windows/desktop/bb773938(v=vs.85).aspx // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.5 +// TypeScript Version: 2.6 + +/// declare namespace DiskQuotaTypeLibrary { // tslint:disable-next-line no-const-enum @@ -136,7 +138,6 @@ interface ActiveXObject { on( obj: DiskQuotaTypeLibrary.DiskQuotaControl, event: 'OnUserNameChanged', argNames: ['pUser'], handler: ( this: DiskQuotaTypeLibrary.DiskQuotaControl, parameter: {readonly pUser: DiskQuotaTypeLibrary.DIDiskQuotaUser}) => void): void; - new(progid: K): ActiveXObjectNameMap[K]; } interface ActiveXObjectNameMap { @@ -146,7 +147,3 @@ interface ActiveXObjectNameMap { interface EnumeratorConstructor { new(col: DiskQuotaTypeLibrary.DiskQuotaControl): Enumerator; } - -interface SafeArray { - _brand: SafeArray; -} diff --git a/types/activex-diskquota/tsconfig.json b/types/activex-diskquota/tsconfig.json index 597d998a96..ce9b55800d 100644 --- a/types/activex-diskquota/tsconfig.json +++ b/types/activex-diskquota/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5", - "scripthost" + "es5" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/activex-excel/activex-excel-tests.ts b/types/activex-excel/activex-excel-tests.ts index 4e577300e5..4f6fab3aa1 100644 --- a/types/activex-excel/activex-excel-tests.ts +++ b/types/activex-excel/activex-excel-tests.ts @@ -1,11 +1,12 @@ +/// /// /// // some helpers const toSafeArray = (...items: T[]): SafeArray => { - const dict = new ActiveXObject('Scripting.Dictionary'); + const dict: Scripting.Dictionary = new ActiveXObject('Scripting.Dictionary'); items.forEach((x, index) => dict.Add(index, x)); - return dict.Items() as SafeArray; + return dict.Items(); }; const inCollection = (collection: { Item(index: any): T }, index: string | number): T | undefined => { let item: T | undefined; @@ -295,11 +296,17 @@ const setColumnVisibility = (visible: boolean) => { const combobox = sheet.OLEObjects('ComboBox1').Object as MSForms.ComboBox; combobox.Clear(); - const enumerator = new Enumerator(dict.Items()); + + // iterate over keys using Enumerator + const enumerator = new Enumerator(dict); enumerator.moveFirst(); while (!enumerator.atEnd()) { combobox.AddItem(enumerator.item()); + enumerator.moveNext(); } + + // alternatively, make a JS array out of the keys, and iterate using forEach + // new VBArray(dict.Keys()).toArray().forEach(x => combobox.AddItem(x)); })(); })(); diff --git a/types/activex-excel/index.d.ts b/types/activex-excel/index.d.ts index cdf2a79551..c55bfe1c42 100644 --- a/types/activex-excel/index.d.ts +++ b/types/activex-excel/index.d.ts @@ -9723,7 +9723,6 @@ interface ActiveXObject { set(obj: Excel.Workbook, propertyName: 'Colors', parameterTypes: [any], newValue: any): 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 - new (progid: K): ActiveXObjectNameMap[K]; } interface ActiveXObjectNameMap { diff --git a/types/activex-excel/tsconfig.json b/types/activex-excel/tsconfig.json index 244ab1d0ef..0b346a4a25 100644 --- a/types/activex-excel/tsconfig.json +++ b/types/activex-excel/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5", - "scripthost" + "es5" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/activex-faxcomexlib/activex-faxcomexlib-tests.ts b/types/activex-faxcomexlib/activex-faxcomexlib-tests.ts index ef3e403998..ae9edbe8c9 100644 --- a/types/activex-faxcomexlib/activex-faxcomexlib-tests.ts +++ b/types/activex-faxcomexlib/activex-faxcomexlib-tests.ts @@ -1,6 +1,7 @@ -/// +/// +/// -const collectionToArray = (col: { Item(index: any): T } | SafeArray) => { +const collectionToArray = (col: { Item(index: any): T }): T[] => { const results: T[] = []; const enumerator = new Enumerator(col); enumerator.moveFirst(); @@ -12,9 +13,9 @@ const collectionToArray = (col: { Item(index: any): T } | SafeArray) => { }; const toSafeArray = (...items: T[]): SafeArray => { - const dict = new ActiveXObject('Scripting.Dictionary'); + const dict: Scripting.Dictionary = new ActiveXObject('Scripting.Dictionary'); items.forEach((x, index) => dict.Add(index, x)); - return dict.Items() as SafeArray; + return dict.Items(); }; const VB = { @@ -422,7 +423,7 @@ the job? document.GroupBroadcastReceipts = true; const jobIDs = document.Submit(''); - collectionToArray(jobIDs).forEach(jobID => WScript.Echo(`The job ID is ${jobID}`)); + new VBArray(jobIDs).toArray().forEach(jobID => WScript.Echo(`The job ID is ${jobID}`)); while (recipients.Count > 0) { recipients.Remove(1); diff --git a/types/activex-faxcomexlib/index.d.ts b/types/activex-faxcomexlib/index.d.ts index d4078061f7..ffd2412ef3 100644 --- a/types/activex-faxcomexlib/index.d.ts +++ b/types/activex-faxcomexlib/index.d.ts @@ -2011,7 +2011,6 @@ interface ActiveXObject { this: FAXCOMEXLib.FaxServer, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; on(obj: FAXCOMEXLib.FaxAccount, event: 'AddRef' | 'Release', handler: (this: FAXCOMEXLib.FaxAccount, parameter: {}) => void): void; on(obj: FAXCOMEXLib.FaxServer, event: 'AddRef' | 'Release', handler: (this: FAXCOMEXLib.FaxServer, parameter: {}) => void): void; - new(progid: K): ActiveXObjectNameMap[K]; } interface ActiveXObjectNameMap { diff --git a/types/activex-faxcomexlib/tsconfig.json b/types/activex-faxcomexlib/tsconfig.json index 6509ab4701..8443d46f26 100644 --- a/types/activex-faxcomexlib/tsconfig.json +++ b/types/activex-faxcomexlib/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5", - "scripthost" + "es5" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/activex-infopath/index.d.ts b/types/activex-infopath/index.d.ts index c00c67e197..9cace4ec2e 100644 --- a/types/activex-infopath/index.d.ts +++ b/types/activex-infopath/index.d.ts @@ -1168,7 +1168,6 @@ interface ActiveXObject { on(obj: InfoPath.Button, event: 'AddRef' | 'Release', handler: (this: InfoPath.Button, parameter: {}) => void): void; on(obj: InfoPath.DataDOM, event: 'AddRef' | 'Release', handler: (this: InfoPath.DataDOM, parameter: {}) => void): void; on(obj: InfoPath.XDocument, event: 'AddRef' | 'Release', handler: (this: InfoPath.XDocument, parameter: {}) => void): void; - new(progid: K): ActiveXObjectNameMap[K]; } interface ActiveXObjectNameMap { diff --git a/types/activex-infopath/tsconfig.json b/types/activex-infopath/tsconfig.json index 6feef8496c..db2712e264 100644 --- a/types/activex-infopath/tsconfig.json +++ b/types/activex-infopath/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5", - "scripthost" + "es5" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/activex-interop/activex-interop-tests.ts b/types/activex-interop/activex-interop-tests.ts new file mode 100644 index 0000000000..06c73aa952 --- /dev/null +++ b/types/activex-interop/activex-interop-tests.ts @@ -0,0 +1,20 @@ +/// + +const dict: Scripting.Dictionary = new ActiveXObject('Scripting.Dictionary'); +dict.Add('one', 1); +dict.Add('two', 2); +dict.Add('three', 3); + +const keyEnumerator = new Enumerator(dict); +keyEnumerator.moveFirst(); +while (!keyEnumerator.atEnd()) { + const item = dict(keyEnumerator.item()); + const power = Math.pow(item, 2); +} + +const keysArray = new VBArray(dict.Keys()).toArray(); +const itemsArray = new VBArray(dict.Items()).toArray(); +for (let i = 0; i < keysArray.length; i++) { + const key = keysArray[i]; + const item = itemsArray[i]; +} diff --git a/types/activex-interop/index.d.ts b/types/activex-interop/index.d.ts new file mode 100644 index 0000000000..3bb13a5351 --- /dev/null +++ b/types/activex-interop/index.d.ts @@ -0,0 +1,111 @@ +// Type definitions for Javascript Automation interop 0.0 +// Project: https://msdn.microsoft.com/en-us/library/ff521046(v=vs.85).aspx +// Definitions by: Zev Spitz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +// tslint:disable-next-line no-empty-interface +interface ActiveXObjectNameMap { } + +interface ActiveXObject { + new (progid: K): ActiveXObjectNameMap[K]; + new(s: string): any; +} +declare var ActiveXObject: ActiveXObject; + +/** + * Represents an Automation SAFEARRAY + */ +declare class SafeArray { + private constructor(); + private SafeArray_typekey: SafeArray; +} + +/** + * Allows enumerating over a COM collection, which may not have indexed item access. + */ +interface Enumerator { + /** + * Returns true if the current item is the last one in the collection, or the collection is empty, + * or the current item is undefined. + */ + atEnd(): boolean; + + /** + * Returns the current item in the collection + */ + item(): T; + + /** + * Resets the current item in the collection to the first item. If there are no items in the collection, + * the current item is set to undefined. + */ + moveFirst(): void; + + /** + * Moves the current item to the next item in the collection. If the enumerator is at the end of + * the collection or the collection is empty, the current item is set to undefined. + */ + moveNext(): void; +} + +interface EnumeratorConstructor { + new (collection: { Item(index: any): T }): Enumerator; + // new (collection: any): Enumerator; +} + +declare var Enumerator: EnumeratorConstructor; + +/** + * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions. + */ +interface VBArray { + /** + * Returns the number of dimensions (1-based). + */ + dimensions(): number; + + /** + * Takes an index for each dimension in the array, and returns the item at the corresponding location. + */ + getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T; + + /** + * Returns the smallest available index for a given dimension. + * @param dimension 1-based dimension (defaults to 1) + */ + lbound(dimension?: number): number; + + /** + * Returns the largest available index for a given dimension. + * @param dimension 1-based dimension (defaults to 1) + */ + ubound(dimension?: number): number; + + /** + * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions, + * each successive dimension is appended to the end of the array. + * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6] + */ + toArray(): T[]; +} + +interface VBArrayConstructor { + new (safeArray: SafeArray): VBArray; +} + +declare var VBArray: VBArrayConstructor; + +/** Automation date (VT_DATE) */ +declare class VarDate { + private constructor(); + private VarDate_typekey: VarDate; +} + +interface DateConstructor { + new(vd: VarDate): Date; +} + +interface Date { + getVarDate: () => VarDate; +} diff --git a/types/activex-interop/tsconfig.json b/types/activex-interop/tsconfig.json new file mode 100644 index 0000000000..49c7698384 --- /dev/null +++ b/types/activex-interop/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ "../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "activex-interop-tests.ts" + ] +} \ No newline at end of file diff --git a/types/activex-interop/tslint.json b/types/activex-interop/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/activex-interop/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/activex-iwshruntimelibrary/activex-iwshruntimelibrary-tests.ts b/types/activex-iwshruntimelibrary/activex-iwshruntimelibrary-tests.ts index 14a90f9a8a..67efbd3eca 100644 --- a/types/activex-iwshruntimelibrary/activex-iwshruntimelibrary-tests.ts +++ b/types/activex-iwshruntimelibrary/activex-iwshruntimelibrary-tests.ts @@ -1,3 +1,16 @@ +/// + +const collectionToArray = (col: { Item(key: any): T }): T[] => { + const results: T[] = []; + const enumerator = new Enumerator(col); + enumerator.moveFirst(); + while (!enumerator.atEnd()) { + results.push(enumerator.item()); + enumerator.moveNext(); + } + return results; +}; + const wshn = new ActiveXObject('WScript.Network'); // https://msdn.microsoft.com/en-us/library/s6wt333f(v=vs.84).aspx diff --git a/types/activex-iwshruntimelibrary/index.d.ts b/types/activex-iwshruntimelibrary/index.d.ts index d5b052eaae..fad992e185 100644 --- a/types/activex-iwshruntimelibrary/index.d.ts +++ b/types/activex-iwshruntimelibrary/index.d.ts @@ -1,14 +1,15 @@ -// Type definitions for Windows Script Host Object Model - IWshRuntimeLibrary 1.0 -// Project: https://msdn.microsoft.com/en-us/library/9bbdkx3k(v=vs.84).aspx +// Type definitions for Windows Script Host Runtime Object Model 0.0 +// Project: https://msdn.microsoft.com/en-us/library/9bbdkx3k.aspx // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 +/// + declare namespace IWshRuntimeLibrary { type WindowStyle = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; type ShortcutWindowStyle = 1 | 3 | 7; - // tslint:disable-next-line no-const-enum const enum ButtonType { OK, OKCancel, @@ -19,7 +20,6 @@ declare namespace IWshRuntimeLibrary { CancelTryagainContinue } - // tslint:disable-next-line no-const-enum const enum EventType { AuditFailure = 5, AuditSuccess = 4, @@ -29,7 +29,6 @@ declare namespace IWshRuntimeLibrary { Warning = 2 } - // tslint:disable-next-line no-const-enum const enum IconType { Stop = 16, QuestionMark = 32, @@ -37,7 +36,6 @@ declare namespace IWshRuntimeLibrary { InformationMark = 64, } - // tslint:disable-next-line no-const-enum const enum PopupType { SecondButtonDefault = 256, ThirdButtonDefault = 512, @@ -46,7 +44,6 @@ declare namespace IWshRuntimeLibrary { RTL = 1048576, } - // tslint:disable-next-line no-const-enum const enum PopupSelection { NoButton = -1, OK = 1, @@ -60,14 +57,12 @@ declare namespace IWshRuntimeLibrary { Continue = 11, } - // tslint:disable-next-line no-const-enum const enum WshExecStatus { WshFailed = 2, WshFinished = 1, WshRunning = 0, } - // tslint:disable-next-line no-const-enum const enum WshWindowStyle { WshHide = 0, WshMaximizedFocus = 3, @@ -77,24 +72,91 @@ declare namespace IWshRuntimeLibrary { WshNormalNoFocus = 4, } - class TextStream { - private 'IWshRuntimeLibrary.TextStream_typekey': TextStream; - private constructor(); - readonly AtEndOfLine: boolean; - readonly AtEndOfStream: boolean; - Close(): void; - readonly Column: number; - readonly Line: number; - Read(Characters: number): string; - ReadAll(): string; - ReadLine(): string; - Skip(Characters: number): void; - SkipLine(): void; - Write(Text: string): void; - WriteBlankLines(Lines: number): void; + class TextStreamBase { + /** + * The column number of the current character position in an input stream. + */ + Column: number; - /** @param string [Text=''] */ - WriteLine(Text?: string): void; + /** + * The current line number in an input stream. + */ + Line: number; + + /** + * Closes a text stream. + * It is not necessary to close standard streams; they close automatically when the process ends. If + * you close a standard stream, be aware that any other pointers to that standard stream become invalid. + */ + Close(): void; + } + + class TextStreamWriter extends TextStreamBase { + private 'IWshRuntimeLibrary.TextStreamWriter_typekey': TextStreamWriter; + private constructor(); + + /** + * Sends a string to an output stream. + */ + Write(s: string): void; + + /** + * Sends a specified number of blank lines (newline characters) to an output stream. + */ + WriteBlankLines(intLines: number): void; + + /** + * Sends a string followed by a newline character to an output stream. + */ + WriteLine(s: string): void; + } + + class TextStreamReader extends TextStreamBase { + private 'IWshRuntimeLibrary.TextStreamReader_typekey': TextStreamReader; + private constructor(); + + /** + * Returns a specified number of characters from an input stream, starting at the current pointer position. + * Does not return until the ENTER key is pressed. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + Read(characters: number): string; + + /** + * Returns all characters from an input stream. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + ReadAll(): string; + + /** + * Returns an entire line from an input stream. + * Although this method extracts the newline character, it does not add it to the returned string. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + ReadLine(): string; + + /** + * Skips a specified number of characters when reading from an input text stream. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.) + */ + Skip(characters: number): void; + + /** + * Skips the next line when reading from an input text stream. + * Can only be used on a stream in reading mode, not writing or appending mode. + */ + SkipLine(): void; + + /** + * Indicates whether the stream pointer position is at the end of a line. + */ + AtEndOfLine: boolean; + + /** + * Indicates whether the stream pointer position is at the end of a stream. + */ + AtEndOfStream: boolean; } /** Generic Collection Object */ @@ -109,7 +171,7 @@ declare namespace IWshRuntimeLibrary { interface WshEnvironment { Count(): number; Item(Name: string): string; - readonly length: number; + readonly Length: number; Remove(Name: string): void; (Name: string): string; } @@ -121,9 +183,9 @@ declare namespace IWshRuntimeLibrary { readonly ExitCode: number; readonly ProcessID: number; readonly Status: WshExecStatus; - readonly StdErr: TextStream; - readonly StdIn: TextStream; - readonly StdOut: TextStream; + readonly StdErr: TextStreamWriter; + readonly StdIn: TextStreamReader; + readonly StdOut: TextStreamWriter; Terminate(): void; } @@ -336,13 +398,40 @@ declare namespace IWshRuntimeLibrary { TargetPath: string; } } +declare namespace WSHControllerLibrary { + class WSHController { + private 'WSHControllerLibrary.WSHController_typekey': WSHController; + private constructor(); + CreateScript(Command: string, Server?: any): any; + } +} -interface ActiveXObject { - set(obj: IWshRuntimeLibrary.WshEnvironment, propertyName: 'Item', parameterTypes: [string], newValue: string): void; - new (progid: K): ActiveXObjectNameMap[K]; +declare namespace ScriptSigner { + class Signer { + private 'ScriptSigner.Signer_typekey': Signer; + private constructor(); + + /** @param Store [Store='my'] */ + Sign(FileExtension: string, Text: string, Certificate: string, Store?: string): string; + + /** @param Store [Store='my'] */ + SignFile(FileName: string, Certificate: string, Store?: string): void; + + /** @param ShowUI [ShowUI=false] */ + Verify(FileExtension: string, Text: string, ShowUI?: boolean): boolean; + + /** @param ShowUI [ShowUI=false] */ + VerifyFile(FileName: string, ShowUI?: boolean): boolean; + } } interface ActiveXObjectNameMap { + 'WSHController': WSHControllerLibrary.WSHController; + 'Scripting.Signer': ScriptSigner.Signer; 'WScript.Network': IWshRuntimeLibrary.WshNetwork; 'WScript.Shell': IWshRuntimeLibrary.WshShell; } + +interface ActiveXObject { + set(obj: IWshRuntimeLibrary.WshEnvironment, propertyName: 'Item', parameterTypes: [string], newValue: string): void; +} diff --git a/types/activex-iwshruntimelibrary/tsconfig.json b/types/activex-iwshruntimelibrary/tsconfig.json index 1fa5abc39b..885ca81980 100644 --- a/types/activex-iwshruntimelibrary/tsconfig.json +++ b/types/activex-iwshruntimelibrary/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5", - "scripthost" + "es5" ], "noImplicitAny": true, "noImplicitThis": true, @@ -21,4 +20,4 @@ "index.d.ts", "activex-iwshruntimelibrary-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/activex-iwshruntimelibrary/tslint.json b/types/activex-iwshruntimelibrary/tslint.json index e60c15844f..ed91c31f9c 100644 --- a/types/activex-iwshruntimelibrary/tslint.json +++ b/types/activex-iwshruntimelibrary/tslint.json @@ -1,3 +1,6 @@ { - "extends": "dtslint/dt.json" + "extends": "dtslint/dt.json", + "rules": { + "no-const-enum": false + } } \ No newline at end of file diff --git a/types/activex-libreoffice/activex-libreoffice-tests.ts b/types/activex-libreoffice/activex-libreoffice-tests.ts index bafe014f59..87cf55eb8c 100644 --- a/types/activex-libreoffice/activex-libreoffice-tests.ts +++ b/types/activex-libreoffice/activex-libreoffice-tests.ts @@ -1,3 +1,5 @@ +/// + (() => { // https://wiki.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Bridge/Automation_Bridge diff --git a/types/activex-libreoffice/index.d.ts b/types/activex-libreoffice/index.d.ts index 1698317e8f..7d8e109861 100644 --- a/types/activex-libreoffice/index.d.ts +++ b/types/activex-libreoffice/index.d.ts @@ -2,7 +2,9 @@ // Project: https://api.libreoffice.org/ // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.6 + +/// declare class type { private typekey: type; @@ -12,9 +14,6 @@ declare class sequence { private typekey: sequence; } -// tslint:disable-next-line no-empty-interface -interface SafeArray {} - declare namespace com.sun.star { namespace accessibility { /** diff --git a/types/activex-libreoffice/tsconfig.json b/types/activex-libreoffice/tsconfig.json index 712ea46ca1..b6e9a7be63 100644 --- a/types/activex-libreoffice/tsconfig.json +++ b/types/activex-libreoffice/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5", - "scripthost" + "es5" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/activex-msforms/index.d.ts b/types/activex-msforms/index.d.ts index c896cc4bf5..a9b5e8f8ac 100644 --- a/types/activex-msforms/index.d.ts +++ b/types/activex-msforms/index.d.ts @@ -1564,7 +1564,6 @@ interface ActiveXObject { set(obj: MSForms.ComboBox | MSForms.ListBox, propertyName: 'Column' | 'List', parameterTypes: [number, number] | [number], newValue: any): void; set(obj: MSForms.ComboBox | MSForms.ListBox, propertyName: 'Column' | 'List', parameterTypes: number[], newValue: SafeArray): void; set(obj: MSForms.ListBox, propertyName: 'Selected', parameterTypes: [any], newValue: boolean): void; - new(progid: K): ActiveXObjectNameMap[K]; } interface ActiveXObjectNameMap { diff --git a/types/activex-msforms/tsconfig.json b/types/activex-msforms/tsconfig.json index 38f907552d..074a493c66 100644 --- a/types/activex-msforms/tsconfig.json +++ b/types/activex-msforms/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5", - "scripthost" + "es5" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/activex-mshtml/activex-mshtml-tests.ts b/types/activex-mshtml/activex-mshtml-tests.ts index 324d3d09e2..bdf7f3dec3 100644 --- a/types/activex-mshtml/activex-mshtml-tests.ts +++ b/types/activex-mshtml/activex-mshtml-tests.ts @@ -1,3 +1,5 @@ +/// + let htmlfile = new ActiveXObject('htmlfile'); let htmldoc = htmlfile.createDocumentFromUrl('https://msdn.microsoft.com/en-us/library/aa741317(v=vs.85).aspx', 'null'); let length = htmldoc.all.length; diff --git a/types/activex-mshtml/index.d.ts b/types/activex-mshtml/index.d.ts index 94466927d7..93b307d3ba 100644 --- a/types/activex-mshtml/index.d.ts +++ b/types/activex-mshtml/index.d.ts @@ -2,7 +2,7 @@ // Project: https://msdn.microsoft.com/en-us/library/aa741317(v=vs.85).aspx // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.6 declare namespace MSHTML { const enum _BEHAVIOR_EVENT { @@ -35570,7 +35570,6 @@ interface ActiveXObject { on(obj: MSHTML.SVGTSpanElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGTSpanElement, parameter: {}) => void): void; on(obj: MSHTML.SVGUseElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGUseElement, parameter: {}) => void): void; on(obj: MSHTML.SVGViewElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGViewElement, parameter: {}) => void): void; - new(progid: K): ActiveXObjectNameMap[K]; } interface ActiveXObjectNameMap { diff --git a/types/activex-mshtml/tsconfig.json b/types/activex-mshtml/tsconfig.json index deba2b6ba3..1ef33423ee 100644 --- a/types/activex-mshtml/tsconfig.json +++ b/types/activex-mshtml/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5", - "scripthost" + "es5" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/activex-msxml2/activex-msxml2-tests.ts b/types/activex-msxml2/activex-msxml2-tests.ts index 470f35d785..01ef12802e 100644 --- a/types/activex-msxml2/activex-msxml2-tests.ts +++ b/types/activex-msxml2/activex-msxml2-tests.ts @@ -1,3 +1,5 @@ +/// + // https://msdn.microsoft.com/en-us/library/ms764708(v=vs.85).aspx { const dom = new ActiveXObject('Msxml2.DOMDocument.6.0'); diff --git a/types/activex-msxml2/index.d.ts b/types/activex-msxml2/index.d.ts index 6f43ba02c5..3ee2b1f050 100644 --- a/types/activex-msxml2/index.d.ts +++ b/types/activex-msxml2/index.d.ts @@ -2,7 +2,9 @@ // Project: https://msdn.microsoft.com/en-us/library/ms763742.aspx // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.6 + +/// declare namespace MSXML2 { /** Schema Object Model Content Types */ @@ -2775,7 +2777,6 @@ declare namespace MSXML2 { interface ActiveXObject { on(obj: MSXML2.DOMDocument60, event: 'ondataavailable' | 'onreadystatechange', handler: (this: MSXML2.DOMDocument60, parameter: {}) => void): void; on(obj: MSXML2.FreeThreadedDOMDocument60, event: 'ondataavailable' | 'onreadystatechange', handler: (this: MSXML2.FreeThreadedDOMDocument60, parameter: {}) => void): void; - new(progid: K): ActiveXObjectNameMap[K]; } interface ActiveXObjectNameMap { diff --git a/types/activex-msxml2/tsconfig.json b/types/activex-msxml2/tsconfig.json index 49c53f71ca..fe55b33d3c 100644 --- a/types/activex-msxml2/tsconfig.json +++ b/types/activex-msxml2/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5", - "scripthost" + "es5" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/activex-office/activex-office-tests.ts b/types/activex-office/activex-office-tests.ts index 7aab0b4521..4dd24fd547 100644 --- a/types/activex-office/activex-office-tests.ts +++ b/types/activex-office/activex-office-tests.ts @@ -1,3 +1,4 @@ +/// /// const collectionToArray = (col: { Item(key: any): T }): T[] => { diff --git a/types/activex-office/tsconfig.json b/types/activex-office/tsconfig.json index 729657e813..6ded50cfda 100644 --- a/types/activex-office/tsconfig.json +++ b/types/activex-office/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5", - "scripthost" + "es5" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/activex-outlook/index.d.ts b/types/activex-outlook/index.d.ts index 37628722b5..2b316d80bd 100644 --- a/types/activex-outlook/index.d.ts +++ b/types/activex-outlook/index.d.ts @@ -4,6 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 +/// /// /// @@ -5855,7 +5856,6 @@ interface ActiveXObject { on(obj: Outlook.TaskRequestDeclineItem, event: 'AfterWrite' | 'BeforeRead' | 'Read' | 'Unload', handler: (this: Outlook.TaskRequestDeclineItem, parameter: {}) => void): void; on(obj: Outlook.TaskRequestItem, event: 'AfterWrite' | 'BeforeRead' | 'Read' | 'Unload', handler: (this: Outlook.TaskRequestItem, parameter: {}) => void): void; on(obj: Outlook.TaskRequestUpdateItem, event: 'AfterWrite' | 'BeforeRead' | 'Read' | 'Unload', handler: (this: Outlook.TaskRequestUpdateItem, parameter: {}) => void): void; - new(progid: K): ActiveXObjectNameMap[K]; } interface ActiveXObjectNameMap { diff --git a/types/activex-outlook/tsconfig.json b/types/activex-outlook/tsconfig.json index 1a9fddc714..1a7c466608 100644 --- a/types/activex-outlook/tsconfig.json +++ b/types/activex-outlook/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5", - "scripthost" + "es5" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/activex-powerpoint/activex-powerpoint-tests.ts b/types/activex-powerpoint/activex-powerpoint-tests.ts index 3f2bedf8cd..eb5a2e4c05 100644 --- a/types/activex-powerpoint/activex-powerpoint-tests.ts +++ b/types/activex-powerpoint/activex-powerpoint-tests.ts @@ -1,5 +1,5 @@ // tslint:disable-next-line no-unnecessary-generics -const collectionToArray = (col: any): T[] => { +const collectionToArray = (col: {Item(index: any): T}): T[] => { const results: T[] = []; const enumerator = new Enumerator(col); enumerator.moveFirst(); @@ -13,8 +13,8 @@ const collectionToArray = (col: any): T[] => { const app = new ActiveXObject('PowerPoint.Application'); (() => { // delete empty textboxes in PowerPoint - collectionToArray(app.ActivePresentation.Slides).forEach(slide => { - collectionToArray(slide.Shapes).filter(shape => + collectionToArray(app.ActivePresentation.Slides).forEach(slide => { + collectionToArray(slide.Shapes).filter(shape => shape.Type === Office.MsoShapeType.msoTextBox && shape.TextFrame.TextRange.Text.trim() === '' ).forEach(shape => shape.Delete()); diff --git a/types/activex-powerpoint/index.d.ts b/types/activex-powerpoint/index.d.ts index ee59fd0be4..34e722a8a0 100644 --- a/types/activex-powerpoint/index.d.ts +++ b/types/activex-powerpoint/index.d.ts @@ -5374,7 +5374,6 @@ interface ActiveXObject { this: PowerPoint.Application, parameter: {readonly Sel: PowerPoint.Selection, Cancel: boolean}) => void): void; on(obj: PowerPoint.Application, event: 'WindowSelectionChange', argNames: ['Sel'], handler: (this: PowerPoint.Application, parameter: {readonly Sel: PowerPoint.Selection}) => void): void; on(obj: PowerPoint.OLEControl, event: 'GotFocus' | 'LostFocus', handler: (this: PowerPoint.OLEControl, parameter: {}) => void): void; - new(progid: K): ActiveXObjectNameMap[K]; } interface ActiveXObjectNameMap { diff --git a/types/activex-powerpoint/tsconfig.json b/types/activex-powerpoint/tsconfig.json index 8a0392da3f..25bcee9fa3 100644 --- a/types/activex-powerpoint/tsconfig.json +++ b/types/activex-powerpoint/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5", - "scripthost" + "es5" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/activex-scripting/activex-scripting-tests.ts b/types/activex-scripting/activex-scripting-tests.ts index 313e480cb5..f3ee3218ca 100644 --- a/types/activex-scripting/activex-scripting-tests.ts +++ b/types/activex-scripting/activex-scripting-tests.ts @@ -1,3 +1,5 @@ +/// + // Note -- running these tests under cscript requires some ES5 polyfills const collectionToArray = (col: { Item(key: any): T }): T[] => { diff --git a/types/activex-scripting/index.d.ts b/types/activex-scripting/index.d.ts index 42e4f0c9e0..0d2ae52343 100644 --- a/types/activex-scripting/index.d.ts +++ b/types/activex-scripting/index.d.ts @@ -4,6 +4,8 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 +/// + declare namespace Scripting { // tslint:disable-next-line:no-const-enum const enum CompareMethod { @@ -489,8 +491,7 @@ declare namespace Scripting { } interface ActiveXObject { - new (progid: K): ActiveXObjectNameMap[K]; - set(obj: Scripting.Dictionary, propertyName: 'Item', parameterTypes: [any], newValue: any): void; + set(obj: Scripting.Dictionary, propertyName: 'Item', parameterTypes: [TKey], newValue: TValue): void; } interface ActiveXObjectNameMap { @@ -498,3 +499,7 @@ interface ActiveXObjectNameMap { 'Scripting.Encoder': Scripting.Encoder; 'Scripting.FileSystemObject': Scripting.FileSystemObject; } + +interface EnumeratorConstructor { + new (dict: Scripting.Dictionary): Enumerator; +} diff --git a/types/activex-scripting/tsconfig.json b/types/activex-scripting/tsconfig.json index e2008551fd..11cfcc44a4 100644 --- a/types/activex-scripting/tsconfig.json +++ b/types/activex-scripting/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5", - "scripthost" + "es5" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/activex-shdocvw/index.d.ts b/types/activex-shdocvw/index.d.ts index 86568f6c5d..f450ea6112 100644 --- a/types/activex-shdocvw/index.d.ts +++ b/types/activex-shdocvw/index.d.ts @@ -4,6 +4,8 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 +/// + declare namespace SHDocVw { // tslint:disable-next-line no-const-enum const enum BrowserBarConstants { @@ -1562,7 +1564,6 @@ interface ActiveXObject { on(obj: SHDocVw.ShellNameSpace, event: 'DoubleClick' | 'Initialized' | 'SelectionChange', handler: (this: SHDocVw.ShellNameSpace, parameter: {}) => void): void; on(obj: SHDocVw.WebBrowser, event: 'DownloadBegin' | 'DownloadComplete' | 'OnQuit', handler: (this: SHDocVw.WebBrowser, parameter: {}) => void): void; on(obj: SHDocVw.WebBrowser_V1, event: 'DownloadBegin' | 'DownloadComplete' | 'WindowActivate' | 'WindowMove' | 'WindowResize', handler: (this: SHDocVw.WebBrowser_V1, parameter: {}) => void): void; - new (progid: K): ActiveXObjectNameMap[K]; } interface ActiveXObjectNameMap { @@ -1571,7 +1572,3 @@ interface ActiveXObjectNameMap { 'Shell.UIHelper': SHDocVw.ShellUIHelper; 'ShellNameSpace.ShellNameSpace': SHDocVw.ShellNameSpace; } - -interface EnumeratorConstructor { - new(col: SHDocVw.ShellWindows): Enumerator; -} diff --git a/types/activex-shdocvw/tsconfig.json b/types/activex-shdocvw/tsconfig.json index 1907cb1ef6..2a388d4c7d 100644 --- a/types/activex-shdocvw/tsconfig.json +++ b/types/activex-shdocvw/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5", - "scripthost" + "es5" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/activex-shell/activex-shell-tests.ts b/types/activex-shell/activex-shell-tests.ts index f236f6e592..b9fd3b18fd 100644 --- a/types/activex-shell/activex-shell-tests.ts +++ b/types/activex-shell/activex-shell-tests.ts @@ -1,4 +1,4 @@ -/// +/// const shell = new ActiveXObject('Shell.Application'); diff --git a/types/activex-shell/index.d.ts b/types/activex-shell/index.d.ts index cb59a11c5e..f12d135979 100644 --- a/types/activex-shell/index.d.ts +++ b/types/activex-shell/index.d.ts @@ -1001,7 +1001,6 @@ interface ActiveXObject { on( obj: Shell32.ShellFolderViewOC, event: 'BeginDrag' | 'DefaultVerbInvoked' | 'EnumDone' | 'SelectionChanged' | 'VerbInvoked', handler: (this: Shell32.ShellFolderViewOC, parameter: {}) => void): void; - new (progid: K): ActiveXObjectNameMap[K]; } interface ActiveXObjectNameMap { diff --git a/types/activex-shell/tsconfig.json b/types/activex-shell/tsconfig.json index f4b549f649..364b5716de 100644 --- a/types/activex-shell/tsconfig.json +++ b/types/activex-shell/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5", - "scripthost" + "es5" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/activex-stdole/index.d.ts b/types/activex-stdole/index.d.ts index e738e4f03d..070a84a30a 100644 --- a/types/activex-stdole/index.d.ts +++ b/types/activex-stdole/index.d.ts @@ -4,15 +4,23 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 +/// + declare namespace stdole { + type IFontDisp = StdFont; + type IPictureDisp = StdPicture; type OLE_COLOR = number; type OLE_XPOS_CONTAINER = number; + type OLE_XPOS_PIXELS = number; + type OLE_YPOS_CONTAINER = number; + type OLE_YPOS_PIXELS = number; + const enum LoadPictureConstants { Color = 4, Default = 0, @@ -79,7 +87,6 @@ declare namespace stdole { interface ActiveXObject { on(obj: stdole.StdFont, event: 'FontChanged', argNames: ['PropertyName'], handler: (this: stdole.StdFont, parameter: {readonly PropertyName: string}) => void): void; - new(progid: K): ActiveXObjectNameMap[K]; } interface ActiveXObjectNameMap { diff --git a/types/activex-stdole/tsconfig.json b/types/activex-stdole/tsconfig.json index cbe3ce7aae..24ea6a5417 100644 --- a/types/activex-stdole/tsconfig.json +++ b/types/activex-stdole/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5", - "scripthost" + "es5" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/activex-vbide/activex-vbide-tests.ts b/types/activex-vbide/activex-vbide-tests.ts index 02209ec9bd..5780d36b1a 100644 --- a/types/activex-vbide/activex-vbide-tests.ts +++ b/types/activex-vbide/activex-vbide-tests.ts @@ -1,3 +1,4 @@ +/// /// const collectionToArray = (col: { Item(key: any): T }): T[] => { diff --git a/types/activex-vbide/tsconfig.json b/types/activex-vbide/tsconfig.json index 6fb205a3c4..5d27488056 100644 --- a/types/activex-vbide/tsconfig.json +++ b/types/activex-vbide/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5", - "scripthost" + "es5" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/activex-wia/activex-wia-tests.ts b/types/activex-wia/activex-wia-tests.ts index 8fc7dcfd2e..25d025cc90 100644 --- a/types/activex-wia/activex-wia-tests.ts +++ b/types/activex-wia/activex-wia-tests.ts @@ -1,3 +1,5 @@ +/// + // Note -- running these tests under cscript requires some ES5 polyfills const collectionToArray = (col: { Item(key: any): T }): T[] => { diff --git a/types/activex-wia/index.d.ts b/types/activex-wia/index.d.ts index 18e474e09c..5a06471ff8 100644 --- a/types/activex-wia/index.d.ts +++ b/types/activex-wia/index.d.ts @@ -4,6 +4,8 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 +/// + declare namespace WIA { /** String versions of globally unique identifiers (GUIDs) that identify common Device and Item commands. */ const enum CommandID { @@ -791,7 +793,6 @@ declare namespace WIA { } interface ActiveXObject { - new(progid: K): ActiveXObjectNameMap[K]; on(obj: WIA.DeviceManager, event: 'OnEvent', argNames: ['EventID', 'DeviceID', 'ItemID'], handler: ( this: WIA.DeviceManager, parameter: { readonly EventID: string, readonly DeviceID: string, readonly ItemID: string }) => void): void; set(obj: WIA.Vector, propertyName: 'Item', parameterTypes: [number], newValue: TItem): void; diff --git a/types/activex-wia/tsconfig.json b/types/activex-wia/tsconfig.json index e77b3d1b66..48ed56e82e 100644 --- a/types/activex-wia/tsconfig.json +++ b/types/activex-wia/tsconfig.json @@ -2,8 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5", - "scripthost" + "es5" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/activex-word/activex-word-tests.ts b/types/activex-word/activex-word-tests.ts index 4a0000e6fa..2b44a5ba22 100644 --- a/types/activex-word/activex-word-tests.ts +++ b/types/activex-word/activex-word-tests.ts @@ -1,5 +1,7 @@ +/// + // tslint:disable-next-line no-unnecessary-generics -const collectionToArray = (col: any): T[] => { +const collectionToArray = (col: {Item(index: any): T}): T[] => { const results: T[] = []; const enumerator = new Enumerator(col); enumerator.moveFirst(); @@ -233,7 +235,7 @@ const activeDoc = app.ActiveDocument; // looping through a collection -- https://msdn.microsoft.com/en-us/vba/word-vba/articles/looping-through-a-collection (() => { - collectionToArray(app.Documents) + collectionToArray(app.Documents) .forEach(openDocument => WScript.Echo(openDocument.Name)); const strMarks = collectionToArray(activeDoc.Bookmarks) diff --git a/types/activex-word/index.d.ts b/types/activex-word/index.d.ts index 879af9021d..f6f559ae16 100644 --- a/types/activex-word/index.d.ts +++ b/types/activex-word/index.d.ts @@ -4,6 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 +/// /// /// /// @@ -12496,7 +12497,6 @@ interface ActiveXObject { set(obj: Word.Document, propertyName: 'ActiveWritingStyle', parameterTypes: [any], newValue: string): void; set(obj: Word.Document, propertyName: 'Compatibility', parameterTypes: [Word.WdCompatibility], newValue: boolean): void; set(obj: Word.System, propertyName: 'PrivateProfileString', parameterTypes: [string, string, string], newValue: string): void; - new(progid: K): ActiveXObjectNameMap[K]; } interface ActiveXObjectNameMap { diff --git a/types/activex-word/tsconfig.json b/types/activex-word/tsconfig.json index c62626ca52..c5316c83c4 100644 --- a/types/activex-word/tsconfig.json +++ b/types/activex-word/tsconfig.json @@ -1,10 +1,7 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es5", - "scripthost" - ], + "lib": ["es5"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, diff --git a/types/aframe/aframe-tests.ts b/types/aframe/aframe-tests.ts index 5af66a09d1..5e2bd23e36 100644 --- a/types/aframe/aframe-tests.ts +++ b/types/aframe/aframe-tests.ts @@ -21,9 +21,9 @@ type MyEntity = AFrame.Entity<{ material: THREE.Material; sound: { pause(): void }; }>; -const camera = document.querySelector('a-entity[camera]').components.camera; -const material = document.querySelector('a-entity[material]').components.material; -document.querySelector('a-entity[sound]').components.sound.pause(); +const camera = (document.querySelector('a-entity[camera]') as MyEntity).components.camera; +const material = (document.querySelector('a-entity[material]') as MyEntity).components.material; +(document.querySelector('a-entity[sound]') as MyEntity).components.sound.pause(); entity.getDOMAttribute('geometry').primitive; @@ -38,21 +38,82 @@ entity.addEventListener('child-detached', (event) => { }); // Components -const Component = AFRAME.registerComponent('test', {}); + +interface TestComponent extends AFrame.Component { + multiply: (f: number) => number; + + data: { + myProperty: any[], + string: string, + num: number + }; + + system: TestSystem; +} + +const Component = AFRAME.registerComponent('test-component', { + schema: { + myProperty: { + default: [], + parse() { return [true]; }, + }, + string: { type: 'string' }, + num: 0 + }, + init() { + this.data.num = 0; + }, + update() {}, + tick() {}, + remove() {}, + pause() {}, + play() {}, + + multiply(this: TestComponent, f: number) { + // Reference to system because both were registered with the same name. + return f * this.data.num * this.system.data.counter; + } +}); // Scene const scene = document.querySelector('a-scene'); scene.hasLoaded; // System -const system = scene.systems['systemName']; + +interface TestSystem extends AFrame.System { + data: { + counter: number; + }; +} + +const testSystem: AFrame.SystemDefinition = { + schema: { + counter: 0 + }, + + init() { + this.data.counter = 1; + } +}; + +AFRAME.registerSystem('test-component', testSystem); // Register Custom Geometry -AFRAME.registerGeometry('a-test-geometry', { + +interface TestGeometry extends AFrame.Geometry { + schema: AFrame.MultiPropertySchema<{ + groupIndex: number; + }>; +} + +AFRAME.registerGeometry('a-test-geometry', { schema: { groupIndex: { default: 0 } }, init(data) { this.geometry = new THREE.Geometry(); + const temp = data.groupIndex; + temp; } }); diff --git a/types/aframe/index.d.ts b/types/aframe/index.d.ts index 0da1ed0ef5..b405de0273 100644 --- a/types/aframe/index.d.ts +++ b/types/aframe/index.d.ts @@ -2,6 +2,7 @@ // Project: https://aframe.io/ // Definitions by: Paul Shannon // Roberto Ritger +// Trygve Wastvedt // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -19,7 +20,7 @@ declare var hasNativeWebVRImplementation: boolean; interface Document { createElement(tagName: string): AFrame.Entity; querySelector(selectors: 'a-scene'): AFrame.Scene; - querySelector>(selectors: string): T; + querySelector(selectors: string): AFrame.Entity; querySelectorAll(selectors: string): NodeListOf | Element>; } @@ -36,15 +37,15 @@ declare namespace AFrame { components: { [ key: string ]: ComponentDescriptor }; geometries: { [ key: string ]: GeometryDescriptor }; primitives: { [ key: string ]: Entity }; - registerComponent(name: string, component: ComponentDefinition): ComponentConstructor; + registerComponent(name: string, component: ComponentDefinition): ComponentConstructor; registerElement(name: string, element: ANode): void; - registerGeometry(name: string, geometry: GeometryDefinition): Geometry; + registerGeometry(name: string, geometry: GeometryDefinition): GeometryConstructor; registerPrimitive(name: string, primitive: PrimitiveDefinition): void; - registerShader(name: string, shader: any): void; - registerSystem(name: string, definition: SystemDefinition): void; + registerShader(name: string, shader: T): ShaderConstructor; + registerSystem(name: string, definition: SystemDefinition): SystemConstructor; schema: SchemaUtils; shaders: { [ key: string ]: ShaderDescriptor }; - systems: { [key: string]: System }; + systems: { [key: string]: SystemConstructor }; THREE: typeof THREE; TWEEN: typeof TWEEN; utils: Utils; @@ -89,54 +90,39 @@ declare namespace AFrame { tick(): void; } - interface Component { + interface Component { attrName?: string; - data?: any; + data: T; dependencies?: string[]; el: Entity; id: string; multiple?: boolean; name: string; - schema: Schema; + schema: Schema; + system: S | undefined; - init(data?: any): void; - pause(): void; - play(): void; - remove(): void; - tick?(time: number, timeDelta: number): void; - update(oldData: any): void; - updateSchema?(): void; + init(this: this, data?: T): void; + pause(this: this): void; + play(this: this): void; + remove(this: this): void; + tick?(this: this, time: number, timeDelta: number): void; + update(this: this, oldData: T): void; + updateSchema?(this: this): void; - extendSchema(update: Schema): void; - flushToDOM(): void; + extendSchema(this: this, update: Schema): void; + flushToDOM(this: this): void; } - interface ComponentConstructor { - new (el: Entity, name: string, id: string): Component; + interface ComponentConstructor { + new (el: Entity, attrValue: string, id: string): T; } - interface ComponentDefinition { - dependencies?: string[]; - el?: Entity; - id?: string; - multiple?: boolean; - schema?: Schema; + type ComponentDefinition = Partial; - init?(data?: any): void; - pause?(): void; - play?(): void; - remove?(): void; - tick?(time: number, timeDelta: number): void; - update?(oldData: any): void; - updateSchema?(): void; - - [ key: string ]: any; - } - - interface ComponentDescriptor { - Component: Component; - dependencies: string[] | null; - multiple: boolean | null; + interface ComponentDescriptor { + Component: ComponentConstructor; + dependencies: string[] | undefined; + multiple: boolean | undefined; // internal APIs2 // parse @@ -144,7 +130,6 @@ declare namespace AFrame { // schema // stringify // type - [ key: string ]: any; } interface Coordinate { @@ -153,8 +138,14 @@ declare namespace AFrame { z: number; } + interface DefaultComponents { + position: Component; + rotation: Component; + scale: Component; + } + interface Entity> extends ANode { - components: C; + components: C & DefaultComponents; isPlaying: boolean; object3D: THREE.Object3D; object3DMap: ObjectMap; @@ -165,8 +156,8 @@ declare namespace AFrame { /** * @deprecated since 0.4.0 */ - getComputedAttribute(attr: string): T; - getDOMAttribute(attr: string): T; + getComputedAttribute(attr: string): Component; + getDOMAttribute(attr: string): any; getObject3D(type: string): THREE.Object3D; getOrCreateObject3D(type: string, construct: any): THREE.Object3D; is(stateName: string): boolean; @@ -179,7 +170,6 @@ declare namespace AFrame { // getAttribute specific usages getAttribute(type: string): any; - getAttribute(attr: string): T; getAttribute(type: 'position' | 'rotation' | 'scale'): Coordinate; // setAttribute specific usages @@ -192,12 +182,18 @@ declare namespace AFrame { addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; } - type DetailEvent = Event & { detail: D }; + type DetailEvent = Event & { + detail: D; + target: EventTarget & Entity; + }; interface EntityEventMap { 'child-attached': DetailEvent<{ el: Element | Entity }>; 'child-detached': DetailEvent<{ el: Element | Entity }>; - 'componentchanged': DetailEvent<{ name: string }>; + 'componentchanged': DetailEvent<{ + name: string, + id: string + }>; 'componentremoved': DetailEvent<{ name: string, id: string, @@ -215,23 +211,28 @@ declare namespace AFrame { interface Geometry { name: string; geometry: THREE.Geometry; - schema: Schema; - update(data: object): void; - [ key: string ]: any; + schema: Schema; + + init(this: this, data: { [P in keyof this['schema']]: any }): void; + // Would like the above to be: + // init?(this: this, data?: { [P in keyof T['schema']]: T['schema'][P]['default'] } ): void; + // I think this is prevented by the following issue: https://github.com/Microsoft/TypeScript/issues/21760. } - interface GeometryDefinition extends ComponentDefinition { - geometry?: THREE.Geometry; + interface GeometryConstructor { + new (): T; } - interface GeometryDescriptor { - Geometry: Geometry; + type GeometryDefinition = Partial; + + interface GeometryDescriptor { + Geometry: GeometryConstructor; schema: Schema; } - interface MultiPropertySchema { - [ key: string ]: SinglePropertySchema; - } + type MultiPropertySchema = { + [P in keyof T]: SinglePropertySchema | T[P]; + }; interface PrimitiveDefinition { defaultComponents?: any; // TODO cleanup type @@ -240,8 +241,9 @@ declare namespace AFrame { transforms?: any; // TODO cleanup type } - type PropertyTypes = 'array' | 'boolean' | 'color' | 'int' | 'number' | 'selector' | - 'selectorAll' | 'src' | 'string' | 'vec2' | 'vec3' | 'vec4'; + type PropertyTypes = 'array' | 'asset' | 'audio' | 'boolean' | 'color' | + 'int' | 'map' | 'model' | 'number' | 'selector' | 'selectorAll' | + 'string' | 'vec2' | 'vec3' | 'vec4'; type SceneEvents = 'enter-vr' | 'exit-vr' | 'loaded' | 'renderstart'; @@ -265,7 +267,7 @@ declare namespace AFrame { addEventListener(type: SceneEvents, listener: EventListener, useCapture?: boolean): void; } - type Schema = SinglePropertySchema | MultiPropertySchema; + type Schema = SinglePropertySchema | MultiPropertySchema; interface SchemaUtils { isSingleProperty(schema: Schema): boolean; @@ -274,11 +276,25 @@ declare namespace AFrame { interface Shader { name: string; - schema: Schema; + data: { [key: string]: any }; + schema: Schema; + material: THREE.Material; + vertexShader: string; + fragmentShader: string; + + init(this: this, data?: this['data']): void; + tick?(this: this, time: number, timeDelta: number): void; + update(this: this, oldData: this['data']): void; } - interface ShaderDescriptor { - Shader: Shader; + interface ShaderConstructor { + new (): T; + } + + type ShaderDefinition = Partial; + + interface ShaderDescriptor { + Shader: ShaderConstructor; schema: Schema; } @@ -287,27 +303,23 @@ declare namespace AFrame { 'default'?: T; parse?(value: string): T; stringify?(value: T): string; - [ key: string ]: any; } interface System { - data: any; - schema: Schema; - init(): void; - pause(): void; - play(): void; - tick?(): void; + data: { [key: string]: any }; + schema: Schema; + init(this: this): void; + pause(this: this): void; + play(this: this): void; + tick?(this: this, t: number, dt: number): void; } - interface SystemDefinition { - schema?: Schema; - init?(): void; - pause?(): void; - play?(): void; - tick?(): void; - [ key: string ]: any; + interface SystemConstructor { + new (scene: Scene): T; } + type SystemDefinition = Partial; + interface Utils { coordinates: { isCoordinate(value: string): boolean; @@ -326,5 +338,8 @@ declare namespace AFrame { diff(a: object, b: object): object; extend(target: object, ... source: object[]): object; extendDeep(target: object, ... source: object[]): object; + + throttle(tickFunction: () => void, minimumInterval: number, optionalContext?: {}): (t: number, dt: number) => void; + throttleTick(tickFunction: (t: number, dt: number) => void, minimumInterval: number, optionalContext?: {}): (t: number, dt: number) => void; } } diff --git a/types/aframe/tslint.json b/types/aframe/tslint.json index 71ee04c4e1..495d29983d 100644 --- a/types/aframe/tslint.json +++ b/types/aframe/tslint.json @@ -1,6 +1,5 @@ { "extends": "dtslint/dt.json", "rules": { - "no-unnecessary-generics": false } } diff --git a/types/ajv-errors/ajv-errors-tests.ts b/types/ajv-errors/ajv-errors-tests.ts new file mode 100644 index 0000000000..d06c80b152 --- /dev/null +++ b/types/ajv-errors/ajv-errors-tests.ts @@ -0,0 +1,5 @@ +import * as Ajv from "ajv"; +import AjvErrors = require("ajv-errors"); + +const ajv = new Ajv({allErrors: true, jsonPointers: true}); +AjvErrors(ajv); diff --git a/types/ajv-errors/index.d.ts b/types/ajv-errors/index.d.ts new file mode 100644 index 0000000000..fed9e4585f --- /dev/null +++ b/types/ajv-errors/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for ajv-errors 1.0 +// Project: https://github.com/epoberezkin/ajv-errors +// Definitions by: Afshawn Lotfi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Ajv } from "ajv"; + +/** + * + * @param ajv Ajv Main Class + * https://github.com/epoberezkin/ajv + * @param options Optional options for Ajv Errors + * https://github.com/epoberezkin/ajv-errors#options + * + */ + +export = AjvErrors; +declare function AjvErrors(ajv: Ajv, options?: {}): Ajv; diff --git a/types/ajv-errors/tsconfig.json b/types/ajv-errors/tsconfig.json new file mode 100644 index 0000000000..c78a24c8c9 --- /dev/null +++ b/types/ajv-errors/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", + "ajv-errors-tests.ts" + ] +} diff --git a/types/ajv-errors/tslint.json b/types/ajv-errors/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ajv-errors/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/algoliasearch/algoliasearch-tests.ts b/types/algoliasearch/algoliasearch-tests.ts index b8cd1db6c5..87fdb95a01 100644 --- a/types/algoliasearch/algoliasearch-tests.ts +++ b/types/algoliasearch/algoliasearch-tests.ts @@ -9,6 +9,7 @@ import { Response, IndexSettings, QueryParameters, + Client } from 'algoliasearch'; let _algoliaResponse: Response = { @@ -78,7 +79,7 @@ let _algoliaIndexSettings: IndexSettings = { ignorePlurals: false, disableTypoToleranceOnAttributes: '', separatorsToIndex: '', - queryType: '', + queryType: 'prefixAll', removeWordsIfNoResults: '', advancedSyntax: false, optionalWords: [''], @@ -86,14 +87,15 @@ let _algoliaIndexSettings: IndexSettings = { disablePrefixOnAttributes: [''], disableExactOnAttributes: [''], exactOnSingleWordQuery: '', - alternativesAsExact: false, + alternativesAsExact: ['ignorePlurals'], attributeForDistinct: '', distinct: false, numericAttributesToIndex: [''], allowCompressionOfIntegerArray: false, altCorrections: [{}], minProximity: 0, - placeholders: '', + placeholders: { '': [''] }, + camelCaseAttributes: [''], }; let _algoliaQueryParameters: QueryParameters = { @@ -147,7 +149,30 @@ let _algoliaQueryParameters: QueryParameters = { minProximity: 0, }; -let index: Index = algoliasearch('', '').initIndex(''); +let client: Client = algoliasearch('', ''); +let index: Index = client.initIndex(''); let search = index.search({ query: '' }); + index.search({ query: '' }, (err, res) => {}); + +// partialUpdateObject +index.partialUpdateObject({}, () => {}); +index.partialUpdateObject({}, false, () => {}); +index.partialUpdateObject({}).then(() => {}); +index.partialUpdateObject({}, false).then(() => {}); + +// partialUpdateObjects +index.partialUpdateObjects([{}], () => {}); +index.partialUpdateObjects([{}], false, () => {}); +index.partialUpdateObjects([{}]).then(() => {}); +index.partialUpdateObjects([{}], false).then(() => {}); + +let indexName : string = index.indexName; + +// complete copy +client.copyIndex('from', 'to').then(()=>{}) +client.copyIndex('from', 'to', ()=> {}) +// with scope +client.copyIndex('from', 'to', ['settings']).then(()=>{}) +client.copyIndex('from', 'to', ['synonyms', 'rules'], ()=> {}) diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index fca13ac161..b2890573ce 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Baptiste Coquelle // Haroen Viaene // Aurélien Hervé +// Samuel Vaillant // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -88,7 +89,16 @@ declare namespace algoliasearch { */ deleteIndex(name: string): Promise; /** - * Copy an index from a specific index to a new one + * Copy an index from a specific index to a new one + * https://github.com/algolia/algoliasearch-client-js#copy-index---copyindex + */ + copyIndex( + from: string, + to: string, + cb: (err: Error, res: Task) => void + ): void; + /** + * Copy settings of an index from a specific index to a new one * https://github.com/algolia/algoliasearch-client-js#copy-index---copyindex */ copyIndex( @@ -98,13 +108,13 @@ declare namespace algoliasearch { cb: (err: Error, res: Task) => void ): void; /** - * Copy an index from a specific index to a new one + * Copy settings of an index from a specific index to a new one * https://github.com/algolia/algoliasearch-client-js#copy-index---copyindex */ copyIndex( from: string, to: string, - scope: ('settings' | 'synonyms' | 'rules')[] + scope?: ('settings' | 'synonyms' | 'rules')[] ): Promise; /** * Move index to a new one (and will overwrite the original one) @@ -230,6 +240,7 @@ declare namespace algoliasearch { * Interface for the index algolia object */ interface Index { + indexName: string; /** * Gets a specific object * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects @@ -286,14 +297,13 @@ declare namespace algoliasearch { * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects */ partialUpdateObject(object: {}, cb: (err: Error, res: Task) => void): void; + partialUpdateObject(object: {}, createIfNotExists: boolean, cb: (err: Error, res: Task) => void): void; /** * Update parameters of a list of objects * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects */ - partialUpdateObjects( - objects: {}[], - cb: (err: Error, res: Task) => void - ): void; + partialUpdateObjects(objects: {}[], cb: (err: Error, res: Task) => void): void; + partialUpdateObjects(objects: {}[], createIfNotExists: boolean, cb: (err: Error, res: Task) => void): void; /** * Delete a specific object * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects @@ -330,7 +340,7 @@ declare namespace algoliasearch { * Wait for an indexing task to be compete * https://github.com/algolia/algoliasearch-client-js#wait-for-operations---waittask */ - waitTask(taskID: number, cb: (err: Error, res: any) => void): void; + waitTask(taskID: number, cb: (err: Error, res: TaskStatus) => void): void; /** * Get an index settings * https://github.com/algolia/algoliasearch-client-js#get-settings---getsettings @@ -531,11 +541,13 @@ declare namespace algoliasearch { * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects */ partialUpdateObject(object: {}): Promise; + partialUpdateObject(object: {}, createIfNotExists: boolean): Promise; /** * Update parameters of a list of objects * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects */ partialUpdateObjects(objects: {}[]): Promise; + partialUpdateObjects(objects: {}[], createIfNotExists?: boolean): Promise; /** * Delete a specific object * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects @@ -560,7 +572,7 @@ declare namespace algoliasearch { * Wait for an indexing task to be compete * https://github.com/algolia/algoliasearch-client-js#wait-for-operations---waittask */ - waitTask(taskID: number): Promise; + waitTask(taskID: number): Promise; /** * Get an index settings * https://github.com/algolia/algoliasearch-client-js#get-settings---getsettings @@ -1394,52 +1406,6 @@ declare namespace algoliasearch { userData?: string | object; } - interface AlgoliaResponse { - /** - * Contains all the hits matching the query - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - hits: any[]; - /** - * Current page - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - page: number; - /** - * Number of total hits matching the query - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - nbHits: number; - /** - * Number of pages - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - nbPage: number; - /** - * Number of hits per pages - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - hitsPerPage: number; - /** - * Engine processing time (excluding network transfer) - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - processingTimeMS: number; - /** - * Query used to perform the search - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - query: string; - /** - * GET parameters used to perform the search - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - params: string; - facets: { - [facetName: string]: { [facetValue: string]: number }; - }; - } - namespace SearchForFacetValues { interface Parameters extends QueryParameters { /** @@ -1480,6 +1446,13 @@ declare namespace algoliasearch { interface Task { taskID: number; + createdAt: string; + objectID?: string; + } + + interface TaskStatus { + status: 'published' | 'notPublished', + pendingTask: boolean, } interface IndexSettings { @@ -1600,7 +1573,7 @@ declare namespace algoliasearch { * 'strict' Hits matching with 2 typos are not retrieved if there are some matching without typos. * https://github.com/algolia/algoliasearch-client-js#typotolerance */ - typoTolerance?: any; + typoTolerance?: boolean | 'min' | 'strict'; /** * If set to false, disables typo tolerance on numeric tokens (numbers). * default: true @@ -1633,7 +1606,7 @@ declare namespace algoliasearch { * 'prefixNone' No query word is interpreted as a prefix. This option is not recommended. * https://github.com/algolia/algoliasearch-client-js#querytype */ - queryType?: any; + queryType?: 'prefixAll' | 'prefixLast' | 'prefixNone'; /** * This option is used to select a strategy in order to avoid having an empty result page * default: 'none' @@ -1699,7 +1672,10 @@ declare namespace algoliasearch { * 'multiWordsSynonym': multiple-words synonym * https://github.com/algolia/algoliasearch-client-js#alternativesasexact */ - alternativesAsExact?: any; + alternativesAsExact?: ( + | "ignorePlurals" + | "singleWordSynonym" + | "multiWordsSynonym")[]; /** * The name of the attribute used for the Distinct feature * default: null @@ -1710,7 +1686,7 @@ declare namespace algoliasearch { * If set to 1, enables the distinct feature, disabled by default, if the attributeForDistinct index setting is set. * https://github.com/algolia/algoliasearch-client-js#distinct */ - distinct?: any; + distinct?: boolean | number; /** * All numerical attributes are automatically indexed as numerical filters * default '' @@ -1737,10 +1713,18 @@ declare namespace algoliasearch { minProximity?: number; /** * This is an advanced use-case to define a token substitutable by a list of words without having the original token searchable - * default: '' + * default: {} * https://github.com/algolia/algoliasearch-client-js#placeholders */ - placeholders?: any; + placeholders?: { + [name: string]: string[], + }; + /** + * List of attributes on which to do a decomposition of camel case words. + * + https://www.algolia.com/doc/api-reference/api-parameters/camelCaseAttributes/ + */ + camelCaseAttributes?: string[]; } interface Response { diff --git a/types/algoliasearch/lite/index.d.ts b/types/algoliasearch/lite/index.d.ts index 588e2ac543..a567a917a8 100644 --- a/types/algoliasearch/lite/index.d.ts +++ b/types/algoliasearch/lite/index.d.ts @@ -3,13 +3,14 @@ // Definitions by: Baptiste Coquelle // Haroen Viaene // Aurélien Hervé +// Samuel Vaillant // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 declare namespace algoliasearch { - /* - Interface for the algolia client object - */ + /** + * Interface for the algolia client object + */ interface Client { /** * Initialization of the index @@ -67,6 +68,7 @@ declare namespace algoliasearch { * Interface for the index algolia object */ interface Index { + indexName: string; /** * Gets a specific object * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects @@ -500,52 +502,6 @@ declare namespace algoliasearch { userData?: string | object; } - interface AlgoliaResponse { - /** - * Contains all the hits matching the query - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - hits: any[]; - /** - * Current page - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - page: number; - /** - * Number of total hits matching the query - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - nbHits: number; - /** - * Number of pages - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - nbPage: number; - /** - * Number of hits per pages - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - hitsPerPage: number; - /** - * Engine processing time (excluding network transfer) - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - processingTimeMS: number; - /** - * Query used to perform the search - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - query: string; - /** - * GET parameters used to perform the search - * https://github.com/algolia/algoliasearch-client-js#response-format - */ - params: string; - facets: { - [facetName: string]: { [facetValue: string]: number }; - }; - } - namespace SearchForFacetValues { interface Parameters extends QueryParameters { /** diff --git a/types/allure-js-commons/allure-js-commons-tests.ts b/types/allure-js-commons/allure-js-commons-tests.ts new file mode 100644 index 0000000000..8ac15b6831 --- /dev/null +++ b/types/allure-js-commons/allure-js-commons-tests.ts @@ -0,0 +1,24 @@ +import Allure from "allure-js-commons"; + +const shouldMakeError = new Allure("test"); // $ExpectError +const allure = new Allure(); + +allure.startSuite("suite"); +allure.startCase("case"); +allure.startCase("case", 123456789); + +allure.endCase("passed"); +allure.endCase("pending"); +allure.endCase("skipped"); +allure.endCase("failed"); +allure.endCase("broken", 1232131232); +allure.endCase("error"); // $ExpectError + +allure.startStep("error"); +allure.endStep("error"); // $ExpectError + +allure.setDescription("description"); +allure.addAttachment("image", {}, "image/jpeg"); +allure.pendingCase("pending"); + +allure.endSuite(); diff --git a/types/allure-js-commons/index.d.ts b/types/allure-js-commons/index.d.ts new file mode 100644 index 0000000000..3ecd9aebf1 --- /dev/null +++ b/types/allure-js-commons/index.d.ts @@ -0,0 +1,111 @@ +// Type definitions for allure-js-commons 0.0 +// Project: https://github.com/allure-framework/allure-js-commons +// Definitions by: Denis Artyuhovich +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +declare class Allure { + constructor(); + + setOptions(options: Allure.Options): void; + + getCurrentSuite(): Allure.Suite; + + getCurrentTest(): Allure.Test; + + startSuite(suiteName: string, timestamp?: number): void; + + endSuite(timestamp?: number): void; + + startCase(testName: string, timestamp?: number): void; + + endCase(status: Allure.Status, err?: {}, timestamp?: number): void; + + startStep(stepName: string, timestamp?: number): void; + + endStep(status: Allure.Status, timestamp?: number): void; + + setDescription(description: string, timestamp?: number): void; + + addAttachment(attachmentName: string, buffer: any, type: string): void; + + pendingCase(testName: string, timestamp?: number): void; +} + +export = Allure; +export as namespace Allure; +declare namespace Allure { + interface Options { + targetDir: string; + } + + type Status = "passed" | "pending" | "skipped" | "failed" | "broken"; + + enum TYPE { + TEXT = "text", + HTML = "html", + MARKDOWN = "markdown" + } + + class Suite { + constructor(name: string, timestamp?: number); + + name: string; + + end(timestamp?: number): void; + + hasTests(): boolean; + + addTest(test: Test): boolean; + + toXML(): string; + } + + class Test { + constructor(name: string, timestamp?: number); + + setDescription(description: string, type: TYPE): void; + + addLabel(name: string, value: string): void; + + addParameter(kind: any, name: string, value: string): void; + + addStep(step: Step): void; + + addAttachment(attachment: Attachment): void; + + end(status: Status, error: Error, timestamp?: number): void; + + toXML(): string; + } + + class Description { + constructor(value: string, type: TYPE); + + toXML(): string; + } + + class Step { + constructor(name: string, timestamp?: number); + + addStep(step: Step): void; + + addAttachment(attachment: Attachment): void; + + end(status: Status, error: Error, timestamp?: number): void; + + toXML(): string; + } + + class Attachment { + constructor(title: string, source: any, size: number, mime: string); + + addStep(step: Step): void; + + addAttachment(attachment: Attachment): void; + + end(status: Status, error: Error, timestamp?: number): void; + + toXML(): string; + } +} diff --git a/types/allure-js-commons/tsconfig.json b/types/allure-js-commons/tsconfig.json new file mode 100644 index 0000000000..e536d9acbd --- /dev/null +++ b/types/allure-js-commons/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, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "allure-js-commons-tests.ts" + ] +} diff --git a/types/allure-js-commons/tslint.json b/types/allure-js-commons/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/allure-js-commons/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/amazon-cognito-auth-js/index.d.ts b/types/amazon-cognito-auth-js/index.d.ts new file mode 100644 index 0000000000..d828fccfc8 --- /dev/null +++ b/types/amazon-cognito-auth-js/index.d.ts @@ -0,0 +1,577 @@ +// Type definitions for amazon-cognito-auth-js 1.2 +// Project: https://github.com/aws/amazon-cognito-auth-js +// Definitions by: Scott Escue +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/* + * Create global variable to provide access to types when used without module + * loading. + */ +export as namespace AmazonCognitoIdentity; + +// Stubs the XDomainRequest built-in from older IE browsers, does not follow the project's interface naming convention +export interface XDomainRequest { + readonly responseText: string; + timeout: number; + onprogress: () => void; + ontimeout: () => void; + onerror: () => void; + onload: () => void; + + open(method: string, url: string): void; + send(data: string): void; + abort(): void; +} + +export interface CognitoSessionData { + /** + * The session's Id token. + */ + IdToken?: CognitoIdToken; + + /** + * The session's refresh token. + */ + RefreshToken?: CognitoRefreshToken; + + /** + * The session's access token. + */ + AccessToken?: CognitoAccessToken; + + /** + * The session's token scopes. + */ + TokenScopes?: CognitoTokenScopes; + + /** + * The session's state. + */ + State?: string; +} + +export interface CognitoAuthOptions { + /** + * Required: User pool application client id. + */ + ClientId: string; + + /** + * Required: The application/user-pools Cognito web hostname,this is set at the Cognito console. + */ + AppWebDomain: string; + + /** + * Optional: The token scopes + */ + TokenScopesArray?: ReadonlyArray; + + /** + * Required: Required: The redirect Uri, which will be launched after authentication as signed in. + */ + RedirectUriSignIn: string; + + /** + * Required: The redirect Uri, which will be launched when signed out. + */ + RedirectUriSignOut: string; + + /** + * Optional: Pre-selected identity provider (this allows to automatically trigger social provider authentication flow). + */ + IdentityProvider?: string; + + /** + * Optional: UserPoolId for the configured cognito userPool. + */ + UserPoolId?: string; + + /** + * Optional: boolean flag indicating if the data collection is enabled to support cognito advanced security features. By default, this flag is set to true. + */ + AdvancedSecurityDataCollectionFlag?: boolean; +} + +export interface CognitoAuthUserHandler { + onSuccess: (authSession: CognitoAuthSession) => void; + onFailure: (err: any) => void; +} + +export interface CognitoConstants { + DOMAIN_SCHEME: string; + DOMAIN_PATH_SIGNIN: string; + DOMAIN_PATH_TOKEN: string; + DOMAIN_PATH_SIGNOUT: string; + DOMAIN_QUERY_PARAM_REDIRECT_URI: string; + DOMAIN_QUERY_PARAM_SIGNOUT_URI: string; + DOMAIN_QUERY_PARAM_RESPONSE_TYPE: string; + DOMAIN_QUERY_PARAM_IDENTITY_PROVIDER: string; + DOMAIN_QUERY_PARAM_USERCONTEXTDATA: string; + CLIENT_ID: string; + STATE: string; + SCOPE: string; + TOKEN: string; + CODE: string; + POST: string; + PARAMETERERROR: string; + SCOPETYPEERROR: string; + QUESTIONMARK: string; + POUNDSIGN: string; + COLONDOUBLESLASH: string; + SLASH: string; + AMPERSAND: string; + EQUALSIGN: string; + SPACE: string; + CONTENTTYPE: string; + CONTENTTYPEVALUE: string; + AUTHORIZATIONCODE: string; + IDTOKEN: string; + ACCESSTOKEN: string; + REFRESHTOKEN: string; + ERROR: string; + ERROR_DESCRIPTION: string; + STRINGTYPE: string; + STATELENGTH: number; + STATEORIGINSTRING: string; + WITHCREDENTIALS: string; + UNDEFINED: string; + SELF: string; + HOSTNAMEREGEX: RegExp; + QUERYPARAMETERREGEX1: RegExp; + QUERYPARAMETERREGEX2: RegExp; + HEADER: { 'Content-Type': string }; +} + +export class CognitoIdToken { + /** + * Constructs a new CognitoIdToken object + * @param IdToken The JWT Id token + */ + constructor(IdToken: string); + + /** + * @returns the record's token. + */ + getJwtToken(): string; + + /** + * Sets new value for id token. + * @param idToken The JWT Id token + */ + setJwtToken(idToken: string): void; + + /** + * @returns the token's expiration (exp member). + */ + getExpiration(): number; + + /** + * @returns the token's payload. + */ + decodePayload(): object; +} + +export class CognitoRefreshToken { + /** + * Constructs a new CognitoRefreshToken object + * @param RefreshToken The JWT refresh token. + */ + constructor(RefreshToken: string); + + /** + * @returns the record's token. + */ + getToken(): string; + + /** + * Sets new value for refresh token. + * @param refreshToken The JWT refresh token. + */ + setToken(refreshToken: string): void; +} + +export class CognitoAccessToken { + /** + * Constructs a new CognitoAccessToken object + * @param AccessToken The JWT access token. + */ + constructor(AccessToken: string); + + /** + * @returns the record's token. + */ + getJwtToken(): string; + + /** + * Sets new value for access token. + * @param accessToken The JWT access token. + */ + setJwtToken(accessToken: string): void; + + /** + * @returns the token's expiration (exp member). + */ + getExpiration(): number; + + /** + * @returns the username from payload. + */ + getUsername(): string; + + /** + * @returns the token's payload. + */ + decodePayload(): object; +} + +export class CognitoTokenScopes { + /** + * Constructs a new CognitoTokenScopes object + * @param TokenScopesArray The token scopes + */ + constructor(TokenScopesArray: ReadonlyArray); + + /** + * @returns the token scopes. + */ + getScopes(): string[]; + + /** + * Sets new value for token scopes. + * @param tokenScopes The token scopes + */ + setTokenScopes(tokenScopes: ReadonlyArray): void; +} + +export class CognitoAuthSession { + /** + * Constructs a new CognitoUserSession object + * @param sessionData The session's tokens, scopes, and state. + */ + constructor(sessionData: CognitoSessionData); + + /** + * @returns the session's Id token + */ + getIdToken(): CognitoIdToken; + + /** + * Set a new Id token + * @param IdToken The session's Id token. + */ + setIdToken(IdToken: CognitoIdToken): void; + + /** + * @returns the session's refresh token + */ + getRefreshToken(): CognitoRefreshToken; + + /** + * Set a new Refresh token + * @param RefreshToken The session's refresh token. + */ + setRefreshToken(RefreshToken: CognitoRefreshToken): void; + + /** + * @returns the session's access token + */ + getAccessToken(): CognitoAccessToken; + + /** + * Set a new Access token + * @param AccessToken The session's access token. + */ + setAccessToken(AccessToken: CognitoAccessToken): void; + + /** + * @returns the session's token scopes + */ + getTokenScopes(): CognitoTokenScopes; + + /** + * Set new token scopes + * @param tokenScopes The session's token scopes. + */ + setTokenScopes(tokenScopes: CognitoTokenScopes): void; + + /** + * @returns the session's state + */ + getState(): string; + + /** + * Set new state + * @param state The session's state. + */ + setState(State: string): void; + + /** + * Checks to see if the session is still valid based on session expiry information found + * in Access and Id Tokens and the current time + * @returns if the session is still valid + */ + isValid(): boolean; +} + +export class CognitoAuth { + /** + * Called on success or error. + */ + userhandler: CognitoAuthUserHandler; + + /** + * Constructs a new CognitoAuth object + * @param options Creation options + */ + constructor(options: CognitoAuthOptions); + + /** + * @returns the constants + */ + getCognitoConstants(): CognitoConstants; + + /** + * @returns the client id + */ + getClientId(): string; + + /** + * @returns the app web domain + */ + getAppWebDomain(): string; + + /** + * method for getting the current user of the application from the local storage + * + * @returns the user retrieved from storage + */ + getCurrentUser(): string; + + /** + * method for setting the current user's name + * @param Username the user's name + */ + setUser(Username: string): void; + + /** + * sets response type to 'code' + */ + useCodeGrantFlow(): void; + + /** + * sets response type to 'token' + */ + useImplicitFlow(): void; + + /** + * @returns the current session for this user + */ + getSignInUserSession(): CognitoAuthSession; + + /** + * @returns the user's username + */ + getUsername(): string; + + /** + * @param Username the user's username + */ + setUsername(Username: string): void; + + /** + * @returns the user's state + */ + getState(): string; + + /** + * @param State the user's state + */ + setState(State: string): void; + + /** + * This is used to get a session, either from the session object or from the local storage, or by using a refresh token + * @param RedirectUriSignIn Required: The redirect Uri, which will be launched after authentication. + * @param TokenScopesArray Required: The token scopes, it is an array of strings specifying all scopes for the tokens. + */ + getSession(): void; + + /** + * Parse the http request response and proceed according to different response types. + * @param httpRequestResponse the http request response + */ + parseCognitoWebResponse(httpRequestResponse: string): void; + + /** + * Get the query parameter map and proceed according to code response type. + * @param Query parameter map + */ + getCodeQueryParameter(map: ReadonlyMap): void; + + /** + * Get the query parameter map and proceed according to token response type. + * @param Query parameter map + */ + getTokenQueryParameter(map: ReadonlyMap): void; + + /** + * Get cached tokens and scopes and return a new session using all the cached data. + * @returns the auth session + */ + getCachedSession(): CognitoAuthSession; + + /** + * This is used to get last signed in user from local storage + * @returns the last user name + */ + getLastUser(): string; + + /** + * This is used to save the session tokens and scopes to local storage. + */ + cacheTokensScopes(): void; + + /** + * Compare two sets if they are identical. + * @param set1 one set + * @param set2 the other set + * @returns boolean value is true if two sets are identical + */ + compareSets(set1: ReadonlySet, set2: ReadonlySet): boolean; + + /** + * Get the hostname from url. + * @param url the url string + * @returns hostname string + */ + getHostName(url: string): string; + + /** + * Get http query parameters and return them as a map. + * @param url the url string + * @param splitMark query parameters split mark (prefix) + * @returns map + */ + getQueryParameters(url: string, splitMark: string): Map; + + /** + * helper function to generate a random string + * @param length the length of string + * @param chars a original string + * @returns a random value. + */ + generateRandomString(length: number, chars: string): string; + + /** + * This is used to clear the session tokens and scopes from local storage + */ + clearCachedTokensScopes(): void; + + /** + * This is used to build a user session from tokens retrieved in the authentication result + * @param refreshToken Successful auth response from server. + */ + refreshSession(refreshToken: string): void; + + /** + * Make the http POST request. + * @param header header JSON object + * @param body body JSON object + * @param url string + * @param onSuccess callback + * @param onFailure callback + */ + makePOSTRequest(header: object, body: object, url: string, + onSuccess: (responseText: string) => void, + onFailure: (responseText: string) => void): void; + + /** + * Create the XHR object + * @param method which method to call + * @param url the url string + * @returns xhr + */ + createCORSRequest(method: string, url: string): XMLHttpRequest | XDomainRequest; + + /** + * The http POST request onFailure callback. + * @param err the error object + */ + onFailure(err: any): void; + + /** + * The http POST request onSuccess callback when refreshing tokens. + * @param jsonData tokens + */ + onSuccessRefreshToken(jsonData: string): void; + + /** + * The http POST request onSuccess callback when exchanging code for tokens. + * @param jsonData tokens + */ + onSuccessExchangeForToken(jsonData: string): void; + + /** + * Launch Cognito Auth UI page. + * @param URL the url to launch + */ + launchUri(URL: string): void; + + /** + * @returns scopes string + */ + getSpaceSeperatedScopeString(): string; + + /** + * Create the FQDN(fully qualified domain name) for authorization endpoint. + * @returns url + */ + getFQDNSignIn(): string; + + /** + * Sign out the user. + */ + signOut(): void; + + /** + * Create the FQDN(fully qualified domain name) for signout endpoint. + * @returns url + */ + getFQDNSignOut(): string; + + /** + * This method returns the encoded data string used for cognito advanced security feature. + * This would be generated only when developer has included the JS used for collecting the + * data on their client. Please refer to documentation to know more about using AdvancedSecurity + * features + */ + getUserContextData(): string; + + /** + * Helper method to let the user know if he has either a valid cached session + * or a valid authenticated session from the app integration callback. + * @returns userSignedIn + */ + isUserSignedIn(): boolean; +} + +export class DateHelper { + /** + * @returns The current time in "ddd MMM D HH:mm:ss UTC YYYY" format. + */ + getNowString(): string; +} + +export class StorageHelper { + /** + * This is used to get a storage object + * @returns the storage + */ + constructor(); + + /** + * This is used to return the storage + * @returns the storage + */ + getStorage(): Storage; +} diff --git a/types/amazon-cognito-auth-js/test/amazon-cognito-auth-js-tests.ts b/types/amazon-cognito-auth-js/test/amazon-cognito-auth-js-tests.ts new file mode 100644 index 0000000000..42e58185e4 --- /dev/null +++ b/types/amazon-cognito-auth-js/test/amazon-cognito-auth-js-tests.ts @@ -0,0 +1,162 @@ +import * as lib from 'amazon-cognito-auth-js'; + +const idToken: lib.CognitoIdToken = new lib.CognitoIdToken('fak3T0ken1=='); +idToken.decodePayload(); // $ExpectType object +idToken.setJwtToken('fak3T0ken2=='); // $ExpectType void +idToken.getJwtToken(); // $ExpectType string +idToken.getExpiration(); // $ExpectType number + +const refreshToken: lib.CognitoRefreshToken = new lib.CognitoRefreshToken('refreshplease=='); +refreshToken.setToken('refreshagainplease=='); // $ExpectType void +refreshToken.getToken(); // $ExpectType string + +const accessToken: lib.CognitoAccessToken = new lib.CognitoAccessToken('fak3T0ken3=='); +accessToken.decodePayload(); // $ExpectType object +accessToken.setJwtToken('fak3T0ken4=='); // $ExpectType void +accessToken.getJwtToken(); // $ExpectType string +accessToken.getExpiration(); // $ExpectType number +accessToken.getUsername(); // $ExpectType string + +const tokenScopes: lib.CognitoTokenScopes = new lib.CognitoTokenScopes(['email', 'custom1']); +tokenScopes.setTokenScopes(['openid']); // $ExpectType void +tokenScopes.getScopes(); // $ExpectType string[] + +let sessionData: lib.CognitoSessionData = {}; +let authSession: lib.CognitoAuthSession = new lib.CognitoAuthSession(sessionData); + +sessionData = { + IdToken: idToken, + RefreshToken: refreshToken, + AccessToken: accessToken, + TokenScopes: tokenScopes, + State: '/myapp/home' +}; +authSession = new lib.CognitoAuthSession(sessionData); + +authSession.setIdToken(new lib.CognitoIdToken('fak3T0ken5==')); // $ExpectType void +authSession.setRefreshToken(new lib.CognitoRefreshToken('refreshmeyetagain==')); // $ExpectType void +authSession.setAccessToken(new lib.CognitoAccessToken('fak3T0ken6==')); // $ExpectType void +authSession.setTokenScopes(new lib.CognitoTokenScopes(['email'])); // $ExpectType void +authSession.setState('/myapp/login'); // $ExpectType void +authSession.getIdToken(); // $ExpectType CognitoIdToken +authSession.getRefreshToken(); // $ExpectType CognitoRefreshToken +authSession.getAccessToken(); // $ExpectType CognitoAccessToken +authSession.getTokenScopes(); // $ExpectType CognitoTokenScopes +authSession.getState(); // $ExpectType string + +let authOptions: lib.CognitoAuthOptions = { + ClientId: '1a2b3c4d5e6f7g', + AppWebDomain: 'myapp.auth.us-east-1.amazoncognito.com', + RedirectUriSignIn: 'https://myapp.com/login', + RedirectUriSignOut: 'https://myapp.com/logout' +}; +let auth: lib.CognitoAuth = new lib.CognitoAuth(authOptions); + +authOptions = { + ClientId: '1a2b3c4d5e6f7g', + AppWebDomain: 'myapp.auth.us-east-1.amazoncognito.com', + TokenScopesArray: ['email', 'openid'], + RedirectUriSignIn: 'https://myapp.com/login', + RedirectUriSignOut: 'https://myapp.com/logout', + IdentityProvider: 'Facebook', + UserPoolId: 'us-east-1_faKE4ReAl', + AdvancedSecurityDataCollectionFlag: true +}; +auth = new lib.CognitoAuth(authOptions); + +auth.getClientId(); // $ExpectType string +auth.getAppWebDomain(); // $ExpectType string +auth.getCurrentUser(); // $ExpectType string +auth.setUser('jane.doe'); // $ExpectType void +auth.useCodeGrantFlow(); // $ExpectType void +auth.useImplicitFlow(); // $ExpectType void +auth.getSignInUserSession(); // $ExpectType CognitoAuthSession +auth.getUsername(); // $ExpectType string +auth.setUsername('john.doe'); // $ExpectType void +auth.getState(); // $ExpectType string +auth.setState('/myhost/default.htm'); // $ExpectType void +auth.getSession(); // $ExpectType void +auth.parseCognitoWebResponse('url&stuff=true'); // $ExpectType void +auth.getCodeQueryParameter(new Map()); // $ExpectType void +auth.getTokenQueryParameter(new Map()); // $ExpectType void +auth.getCachedSession(); // $ExpectType CognitoAuthSession +auth.getLastUser(); // $ExpectType string +auth.cacheTokensScopes(); // $ExpectType void +auth.compareSets(new Set(['1']), new Set(['1'])); // $ExpectType boolean +auth.getHostName('https://site.com/page?size=10'); // $ExpectType string +auth.getQueryParameters('http://site.com?1=1&2=2', '?'); // $ExpectType Map +auth.generateRandomString(5, '159erf'); // $ExpectType string +auth.clearCachedTokensScopes(); // $ExpectType void +auth.refreshSession('refreshToken=='); // $ExpectType void +// $ExpectType void +auth.makePOSTRequest({ 'Content-Type': 'application/json' }, { pool: '2' }, + 'https://auth.com/signin', + (data) => console.log(data), + (error) => console.log(error)); +auth.createCORSRequest('POST', '/myapp/login'); // $ExpectType XMLHttpRequest | XDomainRequest +auth.onFailure('request failed'); // $ExpectType void +auth.onSuccessRefreshToken('{"name":"John", "age":31}'); // $ExpectType void +auth.onSuccessExchangeForToken('{"name":"Jane", "age":30}'); // $ExpectType void +auth.launchUri('https://auth.com/login'); // $ExpectType void +auth.getSpaceSeperatedScopeString(); // $ExpectType string +auth.getFQDNSignIn(); // $ExpectType string +auth.signOut(); // $ExpectType void +auth.getFQDNSignOut(); // $ExpectType string +auth.getUserContextData(); // $ExpectType string +auth.isUserSignedIn(); // $ExpectType boolean + +const userHandler: lib.CognitoAuthUserHandler = { + onSuccess: (authSession: lib.CognitoAuthSession) => console.log(authSession), + onFailure: (error: any) => console.log(error) +}; +auth.userhandler = userHandler; + +const constants: lib.CognitoConstants = auth.getCognitoConstants(); +constants.DOMAIN_SCHEME; // $ExpectType string +constants.DOMAIN_PATH_SIGNIN; // $ExpectType string +constants.DOMAIN_PATH_TOKEN; // $ExpectType string +constants.DOMAIN_PATH_SIGNOUT; // $ExpectType string +constants.DOMAIN_QUERY_PARAM_REDIRECT_URI; // $ExpectType string +constants.DOMAIN_QUERY_PARAM_SIGNOUT_URI; // $ExpectType string +constants.DOMAIN_QUERY_PARAM_RESPONSE_TYPE; // $ExpectType string +constants.DOMAIN_QUERY_PARAM_IDENTITY_PROVIDER; // $ExpectType string +constants.DOMAIN_QUERY_PARAM_USERCONTEXTDATA; // $ExpectType string +constants.CLIENT_ID; // $ExpectType string +constants.STATE; // $ExpectType string +constants.SCOPE; // $ExpectType string +constants.TOKEN; // $ExpectType string +constants.CODE; // $ExpectType string +constants.POST; // $ExpectType string +constants.PARAMETERERROR; // $ExpectType string +constants.SCOPETYPEERROR; // $ExpectType string +constants.QUESTIONMARK; // $ExpectType string +constants.POUNDSIGN; // $ExpectType string +constants.COLONDOUBLESLASH; // $ExpectType string +constants.SLASH; // $ExpectType string +constants.AMPERSAND; // $ExpectType string +constants.EQUALSIGN; // $ExpectType string +constants.SPACE; // $ExpectType string +constants.CONTENTTYPE; // $ExpectType string +constants.CONTENTTYPEVALUE; // $ExpectType string +constants.AUTHORIZATIONCODE; // $ExpectType string +constants.IDTOKEN; // $ExpectType string +constants.ACCESSTOKEN; // $ExpectType string +constants.REFRESHTOKEN; // $ExpectType string +constants.ERROR; // $ExpectType string +constants.ERROR_DESCRIPTION; // $ExpectType string +constants.STRINGTYPE; // $ExpectType string +constants.STATELENGTH; // $ExpectType number +constants.STATEORIGINSTRING; // $ExpectType string +constants.WITHCREDENTIALS; // $ExpectType string +constants.UNDEFINED; // $ExpectType string +constants.SELF; // $ExpectType string +constants.HOSTNAMEREGEX; // $ExpectType RegExp +constants.QUERYPARAMETERREGEX1; // $ExpectType RegExp +constants.QUERYPARAMETERREGEX2; // $ExpectType RegExp +constants.HEADER['Content-Type']; // $ExpectType string + +const dateHelper: lib.DateHelper = new lib.DateHelper(); +dateHelper.getNowString(); // $ExpectType string + +const storageHelper: lib.StorageHelper = new lib.StorageHelper(); +storageHelper.getStorage(); // $ExpectType Storage diff --git a/types/amazon-cognito-auth-js/test/amazon-cognito-auth-js-umd-tests.ts b/types/amazon-cognito-auth-js/test/amazon-cognito-auth-js-umd-tests.ts new file mode 100644 index 0000000000..1e30dbbeb8 --- /dev/null +++ b/types/amazon-cognito-auth-js/test/amazon-cognito-auth-js-umd-tests.ts @@ -0,0 +1,22 @@ +AmazonCognitoIdentity.CognitoIdToken; // $ExpectType typeof CognitoIdToken +AmazonCognitoIdentity.CognitoRefreshToken; // $ExpectType typeof CognitoRefreshToken +AmazonCognitoIdentity.CognitoAccessToken; // $ExpectType typeof CognitoAccessToken +AmazonCognitoIdentity.CognitoTokenScopes; // $ExpectType typeof CognitoTokenScopes +AmazonCognitoIdentity.CognitoAuthSession; // $ExpectType typeof CognitoAuthSession +AmazonCognitoIdentity.CognitoAuth; // $ExpectType typeof CognitoAuth +AmazonCognitoIdentity.DateHelper; // $ExpectType typeof DateHelper +AmazonCognitoIdentity.StorageHelper; // $ExpectType typeof StorageHelper + +const sessionData: AmazonCognitoIdentity.CognitoSessionData = {}; +new AmazonCognitoIdentity.CognitoAuthSession(sessionData); + +const authOptions: AmazonCognitoIdentity.CognitoAuthOptions = { + ClientId: '1a2b3c4d5e6f7g', + AppWebDomain: 'myapp.auth.us-east-1.amazoncognito.com', + RedirectUriSignIn: 'https://myapp.com/login', + RedirectUriSignOut: 'https://myapp.com/logout' +}; +const auth = new AmazonCognitoIdentity.CognitoAuth(authOptions); +auth.userhandler; // $ExpectType CognitoAuthUserHandler +auth.getCognitoConstants(); // $ExpectType CognitoConstants +auth.createCORSRequest('', ''); // $ExpectType XMLHttpRequest | XDomainRequest diff --git a/types/amazon-cognito-auth-js/tsconfig.json b/types/amazon-cognito-auth-js/tsconfig.json new file mode 100644 index 0000000000..df5a9f2d73 --- /dev/null +++ b/types/amazon-cognito-auth-js/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "test/amazon-cognito-auth-js-tests.ts", + "test/amazon-cognito-auth-js-umd-tests.ts" + ] +} diff --git a/types/amazon-cognito-auth-js/tslint.json b/types/amazon-cognito-auth-js/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/amazon-cognito-auth-js/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/amazon-product-api/index.d.ts b/types/amazon-product-api/index.d.ts index 34bafd04f4..f266001632 100644 --- a/types/amazon-product-api/index.d.ts +++ b/types/amazon-product-api/index.d.ts @@ -33,6 +33,8 @@ interface IItemLookupOptions { searchIndex?: string; truncateReviewsAt?: number; variationPage?: string; + domain?: string; + request?: Function; } interface IBrowseNodeLookupOptions { diff --git a/types/angular-animate/index.d.ts b/types/angular-animate/index.d.ts index 6a51b368c8..f05ea66058 100644 --- a/types/angular-animate/index.d.ts +++ b/types/angular-animate/index.d.ts @@ -20,8 +20,11 @@ declare module 'angular' { interface IAnimateCallbackObject { eventFn?: (element: JQuery, doneFunction: Function, options: IAnimationOptions) => any; + beforeSetClass?: (element: JQuery, addedClasses: string, removedClasses: string, doneFunction: Function, options: IAnimationOptions) => any; setClass?: (element: JQuery, addedClasses: string, removedClasses: string, doneFunction: Function, options: IAnimationOptions) => any; + beforeAddClass?: (element: JQuery, addedClasses: string, doneFunction: Function, options: IAnimationOptions) => any; addClass?: (element: JQuery, addedClasses: string, doneFunction: Function, options: IAnimationOptions) => any; + beforeRemoveClass?: (element: JQuery, removedClasses: string, doneFunction: Function, options: IAnimationOptions) => any; removeClass?: (element: JQuery, removedClasses: string, doneFunction: Function, options: IAnimationOptions) => any; enter?: (element: JQuery, doneFunction: Function, options: IAnimationOptions) => any; leave?: (element: JQuery, doneFunction: Function, options: IAnimationOptions) => any; diff --git a/types/angular-desktop-notification/index.d.ts b/types/angular-desktop-notification/index.d.ts index a20d67cd21..6281396b66 100644 --- a/types/angular-desktop-notification/index.d.ts +++ b/types/angular-desktop-notification/index.d.ts @@ -101,7 +101,7 @@ declare module 'angular' { * Note: This property is not currently supported in any browser. * Ref: https://developer.mozilla.org/en-US/docs/Web/API/Notification/vibrate */ - vibrate?: boolean; + vibrate?: any; /** * The onclick property of the Notification interface specifies an event listener to receive click events. diff --git a/types/angular-mocks/index.d.ts b/types/angular-mocks/index.d.ts index ac9e6cece3..051539e2ac 100644 --- a/types/angular-mocks/index.d.ts +++ b/types/angular-mocks/index.d.ts @@ -97,7 +97,7 @@ declare module 'angular' { interface IControllerService { // Although the documentation doesn't state this, locals are optional (controllerConstructor: new (...args: any[]) => T, locals?: any, bindings?: any): T; - (controllerConstructor: Function, locals?: any, bindings?: any): T; + (controllerConstructor: (...args: any[]) => T, locals?: any, bindings?: any): T; (controllerName: string, locals?: any, bindings?: any): T; } diff --git a/types/angular/index.d.ts b/types/angular/index.d.ts index 6dccefc926..89e897a7ad 100644 --- a/types/angular/index.d.ts +++ b/types/angular/index.d.ts @@ -1390,10 +1390,9 @@ declare namespace angular { interface IControllerService { // Although the documentation doesn't state this, locals are optional - (controllerConstructor: new (...args: any[]) => T, locals?: any, later?: boolean, ident?: string): T; - (controllerConstructor: Function, locals?: IControllerLocals, later?: boolean, ident?: string): T; - (controllerConstructor: Function, locals?: any, later?: boolean, ident?: string): T; - (controllerName: string, locals?: any, later?: boolean, ident?: string): T; + (controllerConstructor: new (...args: any[]) => T, locals?: any): T; + (controllerConstructor: (...args: any[]) => T, locals?: any): T; + (controllerName: string, locals?: any): T; } interface IControllerProvider extends IServiceProvider { diff --git a/types/ansi-escapes/ansi-escapes-tests.ts b/types/ansi-escapes/ansi-escapes-tests.ts new file mode 100644 index 0000000000..7de77e797f --- /dev/null +++ b/types/ansi-escapes/ansi-escapes-tests.ts @@ -0,0 +1,3 @@ +import * as ansi from "ansi-escapes"; + +console.log(ansi.cursorUp(2) + ansi.cursorLeft === "\u001B[2A\u001B[1000D"); diff --git a/types/ansi-escapes/index.d.ts b/types/ansi-escapes/index.d.ts new file mode 100644 index 0000000000..519d429545 --- /dev/null +++ b/types/ansi-escapes/index.d.ts @@ -0,0 +1,57 @@ +// Type definitions for ansi-escapes 3.0 +// Project: https://github.com/sindresorhus/ansi-escapes +// Definitions by: Rong Shen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace Ansi { + interface ImageOptions { + width?: number; + height?: number; + preserveAspectRatio?: boolean; + } + + interface Term { + setCwd(cwd: string): string; + } + + interface AnsiEscapes { + cursorTo(x: number, y?: number): string; + cursorMove(x: number, y?: number): string; + cursorUp(count: number): string; + cursorDown(count: number): string; + cursorForward(count: number): string; + cursorBackward(count: number): string; + + cursorLeft: string; + cursorSavePosition: string; + cursorRestorePosition: string; + cursorGetPosition: string; + cursorNextLine: string; + cursorPrevLine: string; + cursorHide: string; + cursorShow: string; + + eraseLines(count: number): string; + + eraseEndLine: string; + eraseStartLine: string; + eraseLine: string; + eraseDown: string; + eraseUp: string; + eraseScreen: string; + scrollUp: string; + scrollDown: string; + + clearScreen: string; + beep: string; + + link(text: string, url: string): string; + image(buf: Buffer, opts?: ImageOptions): string; + iTerm: Term; + } +} + +declare const ansiEscapes: Ansi.AnsiEscapes; +export = ansiEscapes; diff --git a/types/ansi-escapes/tsconfig.json b/types/ansi-escapes/tsconfig.json new file mode 100644 index 0000000000..210be31288 --- /dev/null +++ b/types/ansi-escapes/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", "ansi-escapes-tests.ts"] +} diff --git a/types/ansi-escapes/tslint.json b/types/ansi-escapes/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ansi-escapes/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/ansi-styles/ansi-styles-tests.ts b/types/ansi-styles/ansi-styles-tests.ts index 235f98dce1..d1d21719b4 100644 --- a/types/ansi-styles/ansi-styles-tests.ts +++ b/types/ansi-styles/ansi-styles-tests.ts @@ -1,53 +1,52 @@ +import { EscapeCode } from './escape-code'; +import AnsiStyles = require('ansi-styles'); -import ansi = require('ansi-styles'); +let ansiStyles = AnsiStyles as any, + nsNames = ['modifier', 'color', 'bgColor'], + namespaces = { + modifier: ['reset', 'bold', 'dim', 'italic', 'underline', 'inverse', 'hidden', 'strikethrough'], + color: ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'gray', + 'redBright', 'greenBright', 'yellowBright', 'blueBright', 'magentaBright', 'cyanBright', 'whiteBright'], + bgColor: ['bgBlack', 'bgRed', 'bgGreen', 'bgYellow', 'bgBlue', 'bgMagenta', 'bgCyan', + 'bgBlackBright', 'bgRedBright', 'bgGreenBright', 'bgYellowBright', 'bgBlueBright', 'bgMagentaBright', 'bgCyanBright', 'bgWhiteBright'], + } as any, + styles = [...namespaces.modifier, ...namespaces.color, ...namespaces.bgColor], + codePair = ['open', 'close'], + codeTypes = ['ansi', 'ansi256', 'ansi16m'], + colorFormats = ['ansi', 'rgb', 'hsl', 'hsv', 'hwb', 'cmyk', 'xyz', 'lab', 'lch', 'hex', 'keyword', 'ansi256', 'hcg', 'apple', 'gray'], + codesMap = 'codes'; -var styles = [ - ansi.reset, +checkStyle(ansiStyles, styles); +nsNames.forEach(ns => checkStyle(ansiStyles[ns], namespaces[ns])); - ansi.bold, - ansi.dim, - ansi.italic, - ansi.underline, - ansi.inverse, - ansi.hidden, - ansi.strikethrough, +checkIsMap(ansiStyles[codesMap], `ansiStyles.${codesMap} not a Map.`); +nsNames.forEach(ns => checkExist(ansiStyles[ns], `ansiStyles.${ns} is not exist.`)); - ansi.black, - ansi.red, - ansi.green, - ansi.yellow, - ansi.blue, - ansi.magenta, - ansi.cyan, - ansi.white, - ansi.gray, +['color', 'bgColor'].forEach(ns => checkConverter(ns, ansiStyles[ns], colorFormats)); - ansi.bgBlack, - ansi.bgRed, - ansi.bgGreen, - ansi.bgYellow, - ansi.bgBlue, - ansi.bgMagenta, - ansi.bgCyan, - ansi.bgWhite -] -for (var key in styles) { - check(key, styles[key]) +function checkStyle(namespace: any, styles: string[]) { + styles.forEach(s => checkCodePair(s, namespace[s])); +} +function checkCodePair(styleName: string, pair: any): void { + codePair.forEach(p => checkIsString(pair[p], `${styleName}.${p} is not a string.`)); } -function check(key:string, escapeCodes:ansi.EscapeCodePair): void { - if (uninitialized(escapeCodes.open)) { - throw new Error('key not found ~> ' + key + '.open') - } - if (uninitialized(escapeCodes.close)) { - throw new Error('key not found ~> ' + key + '.close') - } +function checkConverter(nsName: string, namespace: any, formats: string[]) { + formats.forEach(f => codeTypes.forEach(t => checkIsFunction(namespace[t][f], `ansiStyles.${nsName}.${t}.${f} is not a function.`))); + checkIsString(namespace.close, `${namespace}.close is not a string.`); } -function uninitialized(val:any): boolean { - return val === null || val === undefined +function checkExist(val: any, failMsg: string): void { + if (val == null) throw new Error(failMsg); +} +function checkIsString(val: any, failMsg: string): void { + if(typeof val != 'string') throw new Error(failMsg); +} +function checkIsFunction(fn: any, failMsg: string): void { + if (typeof fn != 'function') throw new Error(failMsg); +} +function checkIsMap(map: any, failMsg: string): void { + if (!(map instanceof Map)) throw new Error(failMsg); } - - diff --git a/types/ansi-styles/escape-code.d.ts b/types/ansi-styles/escape-code.d.ts new file mode 100644 index 0000000000..e9b1fe9d42 --- /dev/null +++ b/types/ansi-styles/escape-code.d.ts @@ -0,0 +1,106 @@ +import * as cssKeywords from 'color-name'; + + +export namespace EscapeCode { + export interface CodePair { + open: string; + close: string; + } + + interface Modifier { + reset: CodePair; + bold: CodePair; + dim: CodePair; + /** + * Not widely supported + */ + italic: CodePair; + underline: CodePair; + inverse: CodePair; + hidden: CodePair; + /** + * Not widely supported + */ + strikethrough: CodePair; + } + interface Color { + black: CodePair; + red: CodePair; + green: CodePair; + yellow: CodePair; + blue: CodePair; + magenta: CodePair; + cyan: CodePair; + white: CodePair; + /** + * bright black + */ + gray: CodePair; + grey: CodePair; + + redBright: CodePair; + greenBright: CodePair; + yellowBright: CodePair; + blueBright: CodePair; + magentaBright: CodePair; + cyanBright: CodePair; + whiteBright: CodePair; + } + interface BackgroundColor { + bgBlack: CodePair; + bgRed: CodePair; + bgGreen: CodePair; + bgYellow: CodePair; + bgBlue: CodePair; + bgMagenta: CodePair; + bgCyan: CodePair; + bgWhite: CodePair; + + bgBlackBright: CodePair; + bgRedBright: CodePair; + bgGreenBright: CodePair; + bgYellowBright: CodePair; + bgBlueBright: CodePair; + bgMagentaBright: CodePair; + bgCyanBright: CodePair; + bgWhiteBright: CodePair; + } + + interface Conversions { + ansi: (ansi: number) => string + rgb: (r: number, g: number, b: number) => string + hsl: (h: number, s: number, l: number) => string + hsv: (h: number, s: number, v: number) => string + hwb: (h: number, w: number, b: number) => string + cmyk: (c: number, m: number, y: number, k: number) => string + xyz: (x: number, y: number, z: number) => string + lab: (l: number, a: number, b: number) => string + lch: (l: number, c: number, h: number) => string + hex: (hex: string) => string + /** + * color keyword in css to ansi code + */ + keyword: (keyword: keyof typeof cssKeywords) => string + ansi256: (ansi256: number) => string + hcg: (h: number, c: number, g: number) => string + /** + * apple RGB to ansi code + */ + apple: (r: number, g: number, b: number) => string + gray: (grayscale: number) => string + } + interface ColorType { + /** + * 16 color ansi code + */ + ansi: Conversions + /** + * 256 color ansi code + */ + ansi256: Conversions + /** + * truecolor(16 million color) ansi code + */ + ansi16m: Conversions + } +} diff --git a/types/ansi-styles/index.d.ts b/types/ansi-styles/index.d.ts index 4522ece77a..a07ac962ab 100644 --- a/types/ansi-styles/index.d.ts +++ b/types/ansi-styles/index.d.ts @@ -1,40 +1,74 @@ -// Type definitions for ansi-styles 2.0.1 +// Type definitions for ansi-styles 3.2.1 // Project: https://github.com/sindresorhus/ansi-styles // Definitions by: bryn austin bellomy +// plylrnsdy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +import { EscapeCode } from './escape-code'; -export interface EscapeCodePair { - open: string; - close: string; -} -export declare var reset: EscapeCodePair; +export const reset: EscapeCode.CodePair; +export const bold: EscapeCode.CodePair; +export const dim: EscapeCode.CodePair; +/** + * Not widely supported + */ +export const italic: EscapeCode.CodePair; +export const underline: EscapeCode.CodePair; +export const inverse: EscapeCode.CodePair; +export const hidden: EscapeCode.CodePair; +/** + * Not widely supported + */ +export const strikethrough: EscapeCode.CodePair; -export declare var bold: EscapeCodePair; -export declare var dim: EscapeCodePair; -export declare var italic: EscapeCodePair; -export declare var underline: EscapeCodePair; -export declare var inverse: EscapeCodePair; -export declare var hidden: EscapeCodePair; -export declare var strikethrough: EscapeCodePair; +export const black: EscapeCode.CodePair; +export const red: EscapeCode.CodePair; +export const green: EscapeCode.CodePair; +export const yellow: EscapeCode.CodePair; +export const blue: EscapeCode.CodePair; +export const magenta: EscapeCode.CodePair; +export const cyan: EscapeCode.CodePair; +export const white: EscapeCode.CodePair; +/** + * bright black + */ +export const gray: EscapeCode.CodePair; +export const grey: EscapeCode.CodePair; -export declare var black: EscapeCodePair; -export declare var red: EscapeCodePair; -export declare var green: EscapeCodePair; -export declare var yellow: EscapeCodePair; -export declare var blue: EscapeCodePair; -export declare var magenta: EscapeCodePair; -export declare var cyan: EscapeCodePair; -export declare var white: EscapeCodePair; -export declare var gray: EscapeCodePair; +export const redBright: EscapeCode.CodePair; +export const greenBright: EscapeCode.CodePair; +export const yellowBright: EscapeCode.CodePair; +export const blueBright: EscapeCode.CodePair; +export const magentaBright: EscapeCode.CodePair; +export const cyanBright: EscapeCode.CodePair; +export const whiteBright: EscapeCode.CodePair; -export declare var bgBlack: EscapeCodePair; -export declare var bgRed: EscapeCodePair; -export declare var bgGreen: EscapeCodePair; -export declare var bgYellow: EscapeCodePair; -export declare var bgBlue: EscapeCodePair; -export declare var bgMagenta: EscapeCodePair; -export declare var bgCyan: EscapeCodePair; -export declare var bgWhite: EscapeCodePair; +export const bgBlack: EscapeCode.CodePair; +export const bgRed: EscapeCode.CodePair; +export const bgGreen: EscapeCode.CodePair; +export const bgYellow: EscapeCode.CodePair; +export const bgBlue: EscapeCode.CodePair; +export const bgMagenta: EscapeCode.CodePair; +export const bgCyan: EscapeCode.CodePair; +export const bgWhite: EscapeCode.CodePair; + +export const bgBlackBright: EscapeCode.CodePair; +export const bgRedBright: EscapeCode.CodePair; +export const bgGreenBright: EscapeCode.CodePair; +export const bgYellowBright: EscapeCode.CodePair; +export const bgBlueBright: EscapeCode.CodePair; +export const bgMagentaBright: EscapeCode.CodePair; +export const bgCyanBright: EscapeCode.CodePair; +export const bgWhiteBright: EscapeCode.CodePair; + +/** + * Raw escape codes (i.e. without the CSI escape prefix \u001B[ and render mode postfix m) are available. + * + * This is a Map with the open codes as keys and close codes as values. + */ +export const codes: Map +export const modifier: EscapeCode.Modifier +export const color: EscapeCode.Color & EscapeCode.ColorType & { close: string } +export const bgColor: EscapeCode.BackgroundColor & EscapeCode.ColorType & { close: string } diff --git a/types/arangodb/arangodb-tests.ts b/types/arangodb/arangodb-tests.ts index b498caf6af..7e0fd6383e 100644 --- a/types/arangodb/arangodb-tests.ts +++ b/types/arangodb/arangodb-tests.ts @@ -1,4 +1,4 @@ -import { db, aql } from "@arangodb"; +import { aql, db, query } from "@arangodb"; import { md5 } from "@arangodb/crypto"; import { createRouter } from "@arangodb/foxx"; import sessionsMiddleware = require("@arangodb/foxx/sessions"); @@ -21,15 +21,40 @@ const admin = users.firstExample({ username: "admin" })!; users.update(admin, { password: md5("hunter2") }); console.logLines("user", admin._key, admin.username); -const query = aql` +db._query(aql` FOR u IN ${users} RETURN u -`; +`); -db._createDocumentCollection("bananas").ensureIndex({ +interface Banana { + color: string; + shape: { + type: string; + coords: string[]; + }; +} + +const bananas = db._createDocumentCollection("bananas", { + waitForSync: false, + keyOptions: { + type: "autoincrement", + increment: 11, + offset: 23 + } +}) as ArangoDB.Collection; +bananas.ensureIndex({ type: "hash", unique: true, - fields: ["color", "shape"] + fields: ["color", "shape.type"] +}); +bananas.updateByExample( + bananas.any(), + { shape: { type: "round" } }, + { mergeObjects: true } +); +bananas.ensureIndex({ + type: "geo", + fields: ["latLng"] }); const router = createRouter(); @@ -61,3 +86,13 @@ router.use( transport: cookieTransport({ secret: "banana", algorithm: "sha256" }) }) ); + +console.log( + query` + FOR u IN users + ${aql.literal( + Math.random() < 0.5 ? "FILTER u.admin" : "FILTER !u.admin" + )} + RETURN u + `.toArray() +); diff --git a/types/arangodb/index.d.ts b/types/arangodb/index.d.ts index 34cf3ef99e..5c3f56020f 100644 --- a/types/arangodb/index.d.ts +++ b/types/arangodb/index.d.ts @@ -89,8 +89,9 @@ declare namespace ArangoDB { | "network authentication required"; type EdgeDirection = "any" | "inbound" | "outbound"; type EngineType = "mmfiles" | "rocksdb"; - type IndexType = "hash" | "skiplist" | "fulltext" | "geo1" | "geo2"; + type IndexType = "hash" | "skiplist" | "fulltext" | "geo"; type ViewType = "arangosearch"; + type KeyGeneratorType = "traditional" | "autoincrement"; type ErrorName = | "ERROR_NO_ERROR" | "ERROR_FAILED" @@ -463,12 +464,29 @@ declare namespace ArangoDB { replicationFactor?: number; } + interface CreateCollectionOptions { + waitForSync?: boolean; + journalSize?: number; + isVolatile?: boolean; + isSystem?: boolean; + keyOptions?: { + type?: KeyGeneratorType; + allowUserKeys?: boolean; + increment?: number; + offset?: number; + }; + numberOfShards?: number; + shardKeys?: string[]; + replicationFactor?: number; + } + interface CollectionProperties { waitForSync: boolean; journalSize: number; + isSystem: boolean; isVolatile: boolean; keyOptions?: { - type: string; + type: KeyGeneratorType; allowUserKeys: boolean; increment?: number; offset?: number; @@ -488,7 +506,7 @@ declare namespace ArangoDB { interface IndexDescription { type: IndexType; - fields: ReadonlyArray; + fields: ReadonlyArray; sparse?: boolean; unique?: boolean; deduplicate?: boolean; @@ -497,7 +515,7 @@ declare namespace ArangoDB { interface Index { id: string; type: IndexType; - fields: Array; + fields: Array; sparse: boolean; unique: boolean; deduplicate: boolean; @@ -520,6 +538,8 @@ declare namespace ArangoDB { type DocumentLike = ObjectWithId | ObjectWithKey; + type Patch = { [K in keyof T]?: T[K] | Patch }; + interface DocumentMetadata { _key: string; _id: string; @@ -572,6 +592,7 @@ declare namespace ArangoDB { keepNull?: boolean; waitForSync?: boolean; limit?: number; + mergeObjects?: boolean; } interface RemoveOptions { @@ -706,24 +727,24 @@ declare namespace ArangoDB { ): InsertResult; update( selector: string | DocumentLike, - data: Partial>, + data: Patch>, options?: UpdateOptions ): UpdateResult; update( selectors: ReadonlyArray, - data: ReadonlyArray>>, + data: ReadonlyArray>>, options?: UpdateOptions ): Array>; updateByExample( example: Partial>, - newValue: Partial>, + newValue: Patch>, keepNull?: boolean, waitForSync?: boolean, limit?: number ): number; updateByExample( example: Partial>, - newValue: Partial>, + newValue: Patch>, options?: UpdateByExampleOptions ): number; } @@ -745,6 +766,10 @@ declare namespace ArangoDB { options?: QueryOptions; } + interface AqlLiteral { + toAQL: () => string; + } + interface Cursor { toArray(): T[]; hasNext(): boolean; @@ -862,14 +887,14 @@ declare namespace ArangoDB { // Collection _collection(name: string): Collection; _collections(): Collection[]; - _create(name: string, properties?: CollectionProperties): Collection; + _create(name: string, properties?: CreateCollectionOptions): Collection; _createDocumentCollection( name: string, - properties?: CollectionProperties + properties?: CreateCollectionOptions ): Collection; _createEdgeCollection( name: string, - properties?: CollectionProperties + properties?: CreateCollectionOptions ): Collection; _drop(name: string): void; _truncate(name: string): void; @@ -930,8 +955,26 @@ declare namespace Foxx { set?: (res: Response, sid: string) => void; clear?: (res: Response) => void; } + interface CollectionSessionStorage extends SessionStorage { + new: () => Session; + save: (session: Session) => Session; + clear: (session: Session) => boolean; + prune: () => string[]; + } + interface SessionsMiddleware extends DelegateMiddleware { + storage: SessionStorage; + transport: SessionTransport[]; + } - type Middleware = (req: Request, res: Response, next: NextFunction) => void; + type SimpleMiddleware = ( + req: Request, + res: Response, + next: NextFunction + ) => void; + interface DelegateMiddleware { + register: (endpoint: Endpoint) => SimpleMiddleware; + } + type Middleware = SimpleMiddleware | DelegateMiddleware; type Handler = ((req: Request, res: Response) => void); type NextFunction = () => void; @@ -1214,97 +1257,97 @@ declare namespace Foxx { function route(handler: Handler, name?: string): Endpoint; function route( - pathOrMiddleware: string | Middleware, + pathOrMiddleware: string | SimpleMiddleware, handler: Handler, name?: string ): Endpoint; function route( - pathOrMiddleware: string | Middleware, - middleware: Middleware, + pathOrMiddleware: string | SimpleMiddleware, + middleware: SimpleMiddleware, handler: Handler, name?: string ): Endpoint; function route( - pathOrMiddleware: string | Middleware, - middleware1: Middleware, - middleware2: Middleware, + pathOrMiddleware: string | SimpleMiddleware, + middleware1: SimpleMiddleware, + middleware2: SimpleMiddleware, handler: Handler, name?: string ): Endpoint; function route( - pathOrMiddleware: string | Middleware, - middleware1: Middleware, - middleware2: Middleware, - middleware3: Middleware, + pathOrMiddleware: string | SimpleMiddleware, + middleware1: SimpleMiddleware, + middleware2: SimpleMiddleware, + middleware3: SimpleMiddleware, handler: Handler, name?: string ): Endpoint; function route( - pathOrMiddleware: string | Middleware, - middleware1: Middleware, - middleware2: Middleware, - middleware3: Middleware, - middleware4: Middleware, + pathOrMiddleware: string | SimpleMiddleware, + middleware1: SimpleMiddleware, + middleware2: SimpleMiddleware, + middleware3: SimpleMiddleware, + middleware4: SimpleMiddleware, handler: Handler, name?: string ): Endpoint; function route( - pathOrMiddleware: string | Middleware, - middleware1: Middleware, - middleware2: Middleware, - middleware3: Middleware, - middleware4: Middleware, - middleware5: Middleware, + pathOrMiddleware: string | SimpleMiddleware, + middleware1: SimpleMiddleware, + middleware2: SimpleMiddleware, + middleware3: SimpleMiddleware, + middleware4: SimpleMiddleware, + middleware5: SimpleMiddleware, handler: Handler, name?: string ): Endpoint; function route( - pathOrMiddleware: string | Middleware, - middleware1: Middleware, - middleware2: Middleware, - middleware3: Middleware, - middleware4: Middleware, - middleware5: Middleware, - middleware6: Middleware, + pathOrMiddleware: string | SimpleMiddleware, + middleware1: SimpleMiddleware, + middleware2: SimpleMiddleware, + middleware3: SimpleMiddleware, + middleware4: SimpleMiddleware, + middleware5: SimpleMiddleware, + middleware6: SimpleMiddleware, handler: Handler, name?: string ): Endpoint; function route( - pathOrMiddleware: string | Middleware, - middleware1: Middleware, - middleware2: Middleware, - middleware3: Middleware, - middleware4: Middleware, - middleware5: Middleware, - middleware6: Middleware, - middleware7: Middleware, + pathOrMiddleware: string | SimpleMiddleware, + middleware1: SimpleMiddleware, + middleware2: SimpleMiddleware, + middleware3: SimpleMiddleware, + middleware4: SimpleMiddleware, + middleware5: SimpleMiddleware, + middleware6: SimpleMiddleware, + middleware7: SimpleMiddleware, handler: Handler, name?: string ): Endpoint; function route( - pathOrMiddleware: string | Middleware, - middleware1: Middleware, - middleware2: Middleware, - middleware3: Middleware, - middleware4: Middleware, - middleware5: Middleware, - middleware6: Middleware, - middleware7: Middleware, - middleware8: Middleware, + pathOrMiddleware: string | SimpleMiddleware, + middleware1: SimpleMiddleware, + middleware2: SimpleMiddleware, + middleware3: SimpleMiddleware, + middleware4: SimpleMiddleware, + middleware5: SimpleMiddleware, + middleware6: SimpleMiddleware, + middleware7: SimpleMiddleware, + middleware8: SimpleMiddleware, handler: Handler, name?: string ): Endpoint; function route( - pathOrMiddleware: string | Middleware, - middleware1: Middleware, - middleware2: Middleware, - middleware3: Middleware, - middleware4: Middleware, - middleware5: Middleware, - middleware6: Middleware, - middleware7: Middleware, - middleware8: Middleware, - middleware9: Middleware, + pathOrMiddleware: string | SimpleMiddleware, + middleware1: SimpleMiddleware, + middleware2: SimpleMiddleware, + middleware3: SimpleMiddleware, + middleware4: SimpleMiddleware, + middleware5: SimpleMiddleware, + middleware6: SimpleMiddleware, + middleware7: SimpleMiddleware, + middleware8: SimpleMiddleware, + middleware9: SimpleMiddleware, handler: Handler, name?: string ): Endpoint; @@ -1327,6 +1370,13 @@ declare namespace Foxx { declare module "@arangodb" { function aql(strings: TemplateStringsArray, ...args: any[]): ArangoDB.Query; + namespace aql { + function literal(value: any): ArangoDB.AqlLiteral; + } + function query( + strings: TemplateStringsArray, + ...args: any[] + ): ArangoDB.Cursor; function time(): number; const db: ArangoDB.Database & { [key: string]: ArangoDB.Collection | undefined; @@ -1362,10 +1412,6 @@ declare module "@arangodb/foxx/graphql" { } declare module "@arangodb/foxx/sessions" { - interface SessionsMiddleware extends Foxx.Middleware { - storage: Foxx.SessionStorage; - transport: Foxx.SessionTransport[]; - } interface SessionsOptions { storage: Foxx.SessionStorage | string | ArangoDB.Collection; transport: @@ -1375,7 +1421,9 @@ declare module "@arangodb/foxx/sessions" { | "header"; autoCreate?: boolean; } - function sessionsMiddleware(options: SessionsOptions): Foxx.Middleware; + function sessionsMiddleware( + options: SessionsOptions + ): Foxx.SessionsMiddleware; export = sessionsMiddleware; } @@ -1386,14 +1434,11 @@ declare module "@arangodb/foxx/sessions/storages/collection" { pruneExpired?: boolean; autoUpdate?: boolean; } - interface CollectionStorage extends Foxx.SessionStorage { - prune: () => string[]; - } function collectionStorage( options: | CollectionStorageOptions | CollectionStorageOptions["collection"] - ): CollectionStorage; + ): Foxx.CollectionSessionStorage; export = collectionStorage; } diff --git a/types/argparse/argparse-tests.ts b/types/argparse/argparse-tests.ts index aef18b665b..ed714ada95 100644 --- a/types/argparse/argparse-tests.ts +++ b/types/argparse/argparse-tests.ts @@ -20,6 +20,12 @@ simpleExample.addArgument( help: 'bar foo', } ); +simpleExample.addArgument( + 'positional', + { + help: 'bar foo', + } +); simpleExample.printHelp(); console.log('-----------'); diff --git a/types/argparse/index.d.ts b/types/argparse/index.d.ts index d8907a2ecd..cf4d1f648e 100644 --- a/types/argparse/index.d.ts +++ b/types/argparse/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/nodeca/argparse // Definitions by: Andrew Schurman // Tomasz Łaziuk +// Sebastian Silbermann // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -34,7 +35,7 @@ export class SubParser { } export class ArgumentGroup { - addArgument(args: string[], options?: ArgumentOptions): void; + addArgument(args: string[] | string, options?: ArgumentOptions): void; addArgumentGroup(options?: ArgumentGroupOptions): ArgumentGroup; addMutuallyExclusiveGroup(options?: { required: boolean }): ArgumentGroup; setDefaults(options?: {}): void; diff --git a/types/arrify/arrify-tests.ts b/types/arrify/arrify-tests.ts index 12995781bf..3fee89133d 100644 --- a/types/arrify/arrify-tests.ts +++ b/types/arrify/arrify-tests.ts @@ -1,5 +1,6 @@ import * as arrify from 'arrify'; +/***************** arrify *****************/ arrify(null); arrify(null); @@ -12,3 +13,74 @@ arrify([2, 3]); function test(val?: string | string[]) { arrify(val); } +/***************** arrify *****************/ + +/***************** arrify *****************/ +arrify(undefined); // returns [] + +arrify(null); // returns [] + +{ + const value: number | string[] = 2018; + arrify(value); // returns [2018] +} + +{ + const value: number[] | string | string[] = ['a', 'b']; + arrify(value); // returns ['a', 'b'] +} +/***************** arrify *****************/ + +/***************** arrify *****************/ +arrify(undefined); + +arrify(null); + +{ + const value: boolean | number[] | string[] = true; + // returns [true] + arrify(value); +} + +{ + const value: boolean[] | number | string[] = ['a', 'b']; + // returns ['a', 'b'] + arrify(value); +} +/***************** arrify *****************/ + +/***************** arrify *****************/ +arrify(undefined); + +arrify(null); + +{ + const value: boolean | Date | number[] | string[] = new Date(2018); + // returns [ new Date(2018) ] + arrify(value); +} + +{ + const value: boolean[] | Date[] | number | string = [true, false]; + // returns [true, false] + arrify(value); +} +/***************** arrify *****************/ + +/***************** arrify *****************/ +arrify(undefined); + +arrify(null); + +{ + const value: boolean | Date | number[] | RegExp | string[] = /test/; + // returns [ /test/ ] + arrify(value); +} + +{ + const value: boolean[] | Date[] | number | RegExp[] | string = [/test1/, /test2/]; + // returns [/test1/, /test2/] + arrify(value); +} +/***************** arrify *****************/ diff --git a/types/arrify/index.d.ts b/types/arrify/index.d.ts index 43c06af05f..7c3c588ea6 100644 --- a/types/arrify/index.d.ts +++ b/types/arrify/index.d.ts @@ -14,5 +14,78 @@ * arrify([2, 3]) // returns [2, 3] */ declare function arrify(val: undefined | null | T | T[]): T[]; + +/** + * @example + * // returns [] + * arrify(undefined); + * @example + * // returns [] + * arrify(null); + * @example + * let value: number | string[] = 2018; + * // returns [2018] + * arrify(value); + * @example + * let value: number[] | string | string[] = ['a', 'b']; + * // returns ['a', 'b'] + * arrify(value); + */ +declare function arrify(val: undefined | null | T1 | T2 | T1[] | T2[]): T1[] | T2[]; + +/** + * @example + * // returns [] + * arrify(undefined); + * @example + * // returns [] + * arrify(null); + * @example + * let value: boolean | number[] | string[] = true; + * // returns [true] + * arrify(value); + * @example + * let value: boolean[] | number | string[] = ['a', 'b']; + * // returns ['a', 'b'] + * arrify(value); + */ +declare function arrify(val: undefined | null | T1 | T2 | T3 | T1[] | T2[] | T3[]): T1[] | T2[] | T3[]; + +/** + * @example + * // returns [] + * arrify(undefined); + * @example + * // returns [] + * arrify(null); + * @example + * let value: boolean | Date | number[] | string[] = new Date(2018); + * // returns [ new Date(2018) ] + * arrify(value); + * @example + * let value: boolean[] | Date[] | number | string = [true, false]; + * // returns [true, false] + * arrify(value); + */ +declare function arrify(val: undefined | null | T1 | T2 | T3 | T4 | T1[] | T2[] | T3[] | T4[]): T1[] | T2[] | T3[] | T4[]; + +/** + * @example + * // returns [] + * arrify(undefined); + * @example + * // returns [] + * arrify(null); + * @example + * let value: boolean | Date | number[] | RegExp | string[] = /test/; + * // returns [ /test/ ] + * arrify(value); + * @example + * let value: boolean[] | Date[] | number | RegExp[] | string = [/test1/, /test2/]; + * // returns [/test1/, /test2/] + * arrify(value); + */ +declare function arrify(val: undefined | null | T1 | T2 | T3 | T4 | T5 | T1[] | T2[] | T3[] | T4[] | T5[]): T1[] | T2[] | T3[] | T4[] | T5[]; + declare namespace arrify {} export = arrify; diff --git a/types/async-retry/async-retry-tests.ts b/types/async-retry/async-retry-tests.ts index 68327b66bd..20dfc62c4b 100644 --- a/types/async-retry/async-retry-tests.ts +++ b/types/async-retry/async-retry-tests.ts @@ -10,12 +10,12 @@ const o: Options = { onRetry: (e: Error) => 42 }; -retry( +const hello: Promise = retry( bail => 'hello', { retries: 3 } ); -retry( +const answer: Promise = retry( bail => Promise.resolve(42), { retries: 3 } ); diff --git a/types/async-retry/index.d.ts b/types/async-retry/index.d.ts index a2f65e00a4..6b50c71b63 100644 --- a/types/async-retry/index.d.ts +++ b/types/async-retry/index.d.ts @@ -19,7 +19,7 @@ declare namespace AsyncRetry { onRetry?: (e: Error) => any; } - type RetryFunction = (bail: (e: Error) => A, attempt: number) => A|Promise; + type RetryFunction = (bail: (e: Error) => void, attempt: number) => A|Promise; } export = AsyncRetry; diff --git a/types/atob/atob-tests.ts b/types/atob/atob-tests.ts new file mode 100644 index 0000000000..e2e2618387 --- /dev/null +++ b/types/atob/atob-tests.ts @@ -0,0 +1,3 @@ +import atob from 'atob'; + +atob('foo'); diff --git a/types/atob/index.d.ts b/types/atob/index.d.ts new file mode 100644 index 0000000000..632880f7a6 --- /dev/null +++ b/types/atob/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for atob 2.1 +// Project: https://git.coolaj86.com/coolaj86/atob.js.git +// Definitions by: John Wright +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +export default function(str: string): string; diff --git a/types/atob/tsconfig.json b/types/atob/tsconfig.json new file mode 100644 index 0000000000..70dd7f0fdc --- /dev/null +++ b/types/atob/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "lib": ["es6"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "atob-tests.ts" + ] +} diff --git a/types/atob/tslint.json b/types/atob/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/atob/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/atom/atom-tests.ts b/types/atom/atom-tests.ts index 57420d5059..9d01e194a9 100644 --- a/types/atom/atom-tests.ts +++ b/types/atom/atom-tests.ts @@ -1327,6 +1327,9 @@ function testMarkerLayer() { markers = markerLayer.findMarkers({ containsRange: [[0, 0], pos] }); markers = markerLayer.findMarkers({ containsRange: [[0, 0], [0, 0]] }); + const role = markerLayer.getRole(); + if (role) str = role; + // Marker creation marker = markerLayer.markRange(range); marker = markerLayer.markRange([pos, pos]); @@ -1738,6 +1741,10 @@ function testProject() { subscription = project.onDidAddBuffer(buffer => buffer.id); subscription = project.observeBuffers(buffer => buffer.getUri()); + subscription = project.onDidReplace(projectSpec => { + if (projectSpec != null) str = projectSpec.originPath; + }); + // Accessing the git repository repositories = project.getRepositories(); @@ -1950,32 +1957,54 @@ function testSelection() { selection.insertText("Replacement", { autoDecreaseIndent: true }); selection.insertText("Replacement", { normalizeLineEndings: true }); selection.insertText("Replacement", { undo: "skip" }); + selection.insertText("Replacement", { bypassReadOnly: true }); selection.insertText("Replacement", { select: true, autoIndent: true, autoIndentNewline: true, autoDecreaseIndent: true, normalizeLineEndings: true, - undo: "skip", preserveTrailingLineIndentation: false }); + undo: "skip", preserveTrailingLineIndentation: false, bypassReadOnly: false }); selection.backspace(); + selection.backspace({ bypassReadOnly: true }); selection.deleteToPreviousWordBoundary(); + selection.deleteToPreviousWordBoundary({ bypassReadOnly: false }); selection.deleteToNextWordBoundary(); + selection.deleteToNextWordBoundary({ bypassReadOnly: true }); selection.deleteToBeginningOfWord(); + selection.deleteToBeginningOfWord({ bypassReadOnly: false }); selection.deleteToBeginningOfLine(); + selection.deleteToBeginningOfLine({ bypassReadOnly: true }); selection.delete(); + selection.delete({ bypassReadOnly: false }); selection.deleteToEndOfLine(); + selection.deleteToEndOfLine({ bypassReadOnly: true }); selection.deleteToEndOfWord(); + selection.deleteToEndOfWord({ bypassReadOnly: false }); selection.deleteToBeginningOfSubword(); + selection.deleteToBeginningOfSubword({ bypassReadOnly: true }); selection.deleteToEndOfSubword(); + selection.deleteToEndOfSubword({ bypassReadOnly: false }); selection.deleteSelectedText(); + selection.deleteSelectedText({ bypassReadOnly: true }); selection.deleteLine(); + selection.deleteLine({ bypassReadOnly: false }); selection.joinLines(); + selection.joinLines({ bypassReadOnly: true }); selection.outdentSelectedRows(); + selection.outdentSelectedRows({ bypassReadOnly: false }); selection.autoIndentSelectedRows(); + selection.autoIndentSelectedRows({ bypassReadOnly: true }); selection.toggleLineComments(); + selection.toggleLineComments({ bypassReadOnly: false }); selection.cutToEndOfLine(); + selection.cutToEndOfLine(true); + selection.cutToEndOfLine(undefined, { bypassReadOnly: true }); selection.cutToEndOfBufferLine(); + selection.cutToEndOfBufferLine(true); + selection.cutToEndOfBufferLine(false, { bypassReadOnly: false }); selection.cut(); selection.cut(true); selection.cut(true, true); + selection.cut(undefined, undefined, { bypassReadOnly: true }); selection.copy(); selection.copy(true); @@ -1983,6 +2012,7 @@ function testSelection() { selection.fold(); selection.indentSelectedRows(); + selection.indentSelectedRows({ bypassReadOnly: false }); // Managing multiple selections selection.addSelectionBelow(); @@ -2143,6 +2173,8 @@ function testTextBuffer() { num = nextRow; } + bool = buffer.hasAstral(); + // Mutating Text range = buffer.setText("Test"); buffer.setTextViaDiff("Test"); @@ -2232,9 +2264,13 @@ function testTextBuffer() { // History bool = buffer.undo(); + bool = buffer.undo({ selectionsMarkerLayer: markerLayer }); bool = buffer.redo(); + bool = buffer.redo({ selectionsMarkerLayer: markerLayer }); - num = buffer.transact(500, (): number => 42); + num = buffer.transact(500, (): number => 42); + num = buffer.transact({ groupingInterval: 500, selectionsMarkerLayer: markerLayer }, + (): number => 42); buffer.clearUndoStack(); num = buffer.createCheckpoint(); @@ -2434,6 +2470,8 @@ function testTextEditor() { // Mutating Text editor.setText("Test"); + editor.setText("Test", {}); + editor.setText("Text", { bypassReadOnly: true }); range = editor.setTextInBufferRange(range, "Test"); range = editor.setTextInBufferRange([pos, pos], "Test"); @@ -2443,7 +2481,7 @@ function testTextEditor() { range = editor.setTextInBufferRange(range, "Test", {}); range = editor.setTextInBufferRange([pos, pos], "Test", { normalizeLineEndings: true }); range = editor.setTextInBufferRange(range, "Test", { normalizeLineEndings: true, - undo: "skip" }); + undo: "skip", bypassReadOnly: false }); editor.insertText("Test"); editor.insertText("Test", {}); @@ -2455,27 +2493,45 @@ function testTextEditor() { editor.insertText("Test", { undo: "skip" }); editor.insertText("Text", { autoDecreaseIndent: false, autoIndent: false, autoIndentNewline: false, normalizeLineEndings: false, select: false, - undo: "skip", preserveTrailingLineIndentation: true }); + undo: "skip", preserveTrailingLineIndentation: true, bypassReadOnly: true }); editor.insertNewline(); + editor.insertNewline({ bypassReadOnly: false }); editor.delete(); + editor.delete({ bypassReadOnly: true }); editor.backspace(); + editor.backspace({ bypassReadOnly: false }); editor.mutateSelectedText((selection, index) => { selection.clear(); }); editor.transpose(); + editor.transpose({ bypassReadOnly: true }); editor.upperCase(); + editor.upperCase({ bypassReadOnly: false }); editor.lowerCase(); + editor.lowerCase({ bypassReadOnly: true }); editor.toggleLineCommentsInSelection(); + editor.toggleLineCommentsInSelection({ bypassReadOnly: false }); editor.insertNewlineBelow(); + editor.insertNewlineBelow({ bypassReadOnly: true }); editor.insertNewlineAbove(); + editor.insertNewlineAbove({ bypassReadOnly: false }); editor.deleteToBeginningOfWord(); + editor.deleteToBeginningOfWord({ bypassReadOnly: true }); editor.deleteToPreviousWordBoundary(); + editor.deleteToPreviousWordBoundary({ bypassReadOnly: false }); editor.deleteToNextWordBoundary(); + editor.deleteToNextWordBoundary({ bypassReadOnly: true }); editor.deleteToBeginningOfSubword(); + editor.deleteToBeginningOfSubword({ bypassReadOnly: false }); editor.deleteToEndOfSubword(); + editor.deleteToEndOfSubword({ bypassReadOnly: true }); editor.deleteToBeginningOfLine(); + editor.deleteToBeginningOfLine({ bypassReadOnly: false }); editor.deleteToEndOfLine(); + editor.deleteToEndOfLine({ bypassReadOnly: true }); editor.deleteToEndOfWord(); + editor.deleteToEndOfWord({ bypassReadOnly: false }); editor.deleteLine(); + editor.deleteLine({ bypassReadOnly: true }); // History editor.undo(); @@ -2923,9 +2979,12 @@ function testTextEditor() { editor.setIndentationForBufferRow(42, 42, { preserveLeadingWhitespace: true }); editor.indentSelectedRows(); + editor.indentSelectedRows({ bypassReadOnly: false }); editor.outdentSelectedRows(); + editor.outdentSelectedRows({ bypassReadOnly: true }); num = editor.indentLevelForLine("Test"); editor.autoIndentSelectedRows(); + editor.autoIndentSelectedRows({ bypassReadOnly: false }); // Grammars grammar = editor.getGrammar(); @@ -2942,6 +3001,7 @@ function testTextEditor() { // Clipboard Operations editor.copySelectedText(); editor.cutSelectedText(); + editor.cutSelectedText({ bypassReadOnly: true }); editor.pasteText(); editor.pasteText({}); @@ -2951,11 +3011,14 @@ function testTextEditor() { editor.pasteText({ normalizeLineEndings: true }); editor.pasteText({ select: true }); editor.pasteText({ undo: "skip" }); + editor.pasteText({ bypassReadOnly: false }); editor.pasteText({ autoIndentNewline: true, autoIndent: true, autoDecreaseIndent: true, - normalizeLineEndings: true, select: true, undo: "skip" }); + normalizeLineEndings: true, select: true, undo: "skip", bypassReadOnly: true }); editor.cutToEndOfLine(); + editor.cutToEndOfLine({ bypassReadOnly: false }); editor.cutToEndOfBufferLine(); + editor.cutToEndOfBufferLine({ bypassReadOnly: true }); // Folds editor.foldCurrentRow(); diff --git a/types/atom/index.d.ts b/types/atom/index.d.ts index 3cee95ace5..232c20a034 100644 --- a/types/atom/index.d.ts +++ b/types/atom/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Atom 1.26 +// Type definitions for Atom 1.27 // 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.26.0/exports/atom.js +// https://github.com/atom/atom/blob/v1.27.0/exports/atom.js /// @@ -1004,6 +1004,9 @@ export interface MarkerLayer { /** Find markers in the layer conforming to the given parameters. */ findMarkers(params: FindMarkerOptions): Marker[]; + /** Get the role of the marker layer e.g. "atom.selection". */ + getRole(): string | undefined; + // Marker Creation /** Create a marker with the given range. */ markRange(range: RangeCompatible, options?: { reversed?: boolean, invalidate?: @@ -1525,29 +1528,29 @@ export class TextEditor { // Mutating Text /** Replaces the entire contents of the buffer with the given string. */ - setText(text: string): void; + setText(text: string, options?: ReadonlyEditOptions): void; /** Set the text in the given Range in buffer coordinates. */ setTextInBufferRange(range: RangeCompatible, text: string, options?: - TextEditOptions): Range; + TextEditOptions & ReadonlyEditOptions): Range; /* For each selection, replace the selected text with the given text. */ - insertText(text: string, options?: TextInsertionOptions): Range|false; + insertText(text: string, options?: TextInsertionOptions & ReadonlyEditOptions): Range|false; /** For each selection, replace the selected text with a newline. */ - insertNewline(): void; + insertNewline(options?: ReadonlyEditOptions): void; /** * For each selection, if the selection is empty, delete the character following * the cursor. Otherwise delete the selected text. */ - delete(): void; + delete(options?: ReadonlyEditOptions): void; /** * For each selection, if the selection is empty, delete the character preceding * the cursor. Otherwise delete the selected text. */ - backspace(): void; + backspace(options?: ReadonlyEditOptions): void; /** * Mutate the text of all the selections in a single transaction. @@ -1561,89 +1564,89 @@ export class TextEditor { * If the selection is empty, the characters preceding and following the cursor * are swapped. Otherwise, the selected characters are reversed. */ - transpose(): void; + transpose(options?: ReadonlyEditOptions): void; /** * Convert the selected text to upper case. * For each selection, if the selection is empty, converts the containing word * to upper case. Otherwise convert the selected text to upper case. */ - upperCase(): void; + upperCase(options?: ReadonlyEditOptions): void; /** * Convert the selected text to lower case. * For each selection, if the selection is empty, converts the containing word * to upper case. Otherwise convert the selected text to upper case. */ - lowerCase(): void; + lowerCase(options?: ReadonlyEditOptions): void; /** * Toggle line comments for rows intersecting selections. * If the current grammar doesn't support comments, does nothing. */ - toggleLineCommentsInSelection(): void; + toggleLineCommentsInSelection(options?: ReadonlyEditOptions): void; /** For each cursor, insert a newline at beginning the following line. */ - insertNewlineBelow(): void; + insertNewlineBelow(options?: ReadonlyEditOptions): void; /** For each cursor, insert a newline at the end of the preceding line. */ - insertNewlineAbove(): void; + insertNewlineAbove(options?: ReadonlyEditOptions): void; /** * For each selection, if the selection is empty, delete all characters of the * containing word that precede the cursor. Otherwise delete the selected text. */ - deleteToBeginningOfWord(): void; + deleteToBeginningOfWord(options?: ReadonlyEditOptions): void; /** * Similar to ::deleteToBeginningOfWord, but deletes only back to the previous * word boundary. */ - deleteToPreviousWordBoundary(): void; + deleteToPreviousWordBoundary(options?: ReadonlyEditOptions): void; /** Similar to ::deleteToEndOfWord, but deletes only up to the next word boundary. */ - deleteToNextWordBoundary(): void; + deleteToNextWordBoundary(options?: ReadonlyEditOptions): void; /** * For each selection, if the selection is empty, delete all characters of the * containing subword following the cursor. Otherwise delete the selected text. */ - deleteToBeginningOfSubword(): void; + deleteToBeginningOfSubword(options?: ReadonlyEditOptions): void; /** * For each selection, if the selection is empty, delete all characters of the * containing subword following the cursor. Otherwise delete the selected text. */ - deleteToEndOfSubword(): void; + deleteToEndOfSubword(options?: ReadonlyEditOptions): void; /** * For each selection, if the selection is empty, delete all characters of the * containing line that precede the cursor. Otherwise delete the selected text. */ - deleteToBeginningOfLine(): void; + deleteToBeginningOfLine(options?: ReadonlyEditOptions): void; /** * For each selection, if the selection is not empty, deletes the selection * otherwise, deletes all characters of the containing line following the cursor. * If the cursor is already at the end of the line, deletes the following newline. */ - deleteToEndOfLine(): void; + deleteToEndOfLine(options?: ReadonlyEditOptions): void; /** * For each selection, if the selection is empty, delete all characters of the * containing word following the cursor. Otherwise delete the selected text. */ - deleteToEndOfWord(): void; + deleteToEndOfWord(options?: ReadonlyEditOptions): void; /** Delete all lines intersecting selections. */ - deleteLine(): void; + deleteLine(options?: ReadonlyEditOptions): void; // History /** Undo the last change. */ - undo(): void; + undo(options?: ReadonlyEditOptions): void; /** Redo the last change. */ - redo(): void; + redo(options?: ReadonlyEditOptions): void; /** * Batch multiple operations as a single undo/redo step. @@ -2284,10 +2287,10 @@ export class TextEditor { { preserveLeadingWhitespace?: boolean }): void; /** Indent rows intersecting selections by one level. */ - indentSelectedRows(): void; + indentSelectedRows(options?: ReadonlyEditOptions): void; /** Outdent rows intersecting selections by one level. */ - outdentSelectedRows(): void; + outdentSelectedRows(options?: ReadonlyEditOptions): void; /** * Get the indentation level of the given line of text. @@ -2298,7 +2301,7 @@ export class TextEditor { indentLevelForLine(line: string): number; /** Indent rows intersecting selections based on the grammar's suggested indent level. */ - autoIndentSelectedRows(): void; + autoIndentSelectedRows(options?: ReadonlyEditOptions): void; // Grammars /** Get the current Grammar of this editor. */ @@ -2328,7 +2331,7 @@ export class TextEditor { copySelectedText(): void; /** For each selection, cut the selected text. */ - cutSelectedText(): void; + cutSelectedText(options?: ReadonlyEditOptions): void; /** * For each selection, replace the selected text with the contents of the clipboard. @@ -2336,19 +2339,19 @@ export class TextEditor { * each selection will be replaced with the content of the corresponding clipboard * selection text. */ - pasteText(options?: TextInsertionOptions): void; + pasteText(options?: TextInsertionOptions & ReadonlyEditOptions): void; /** * For each selection, if the selection is empty, cut all characters of the * containing screen line following the cursor. Otherwise cut the selected text. */ - cutToEndOfLine(): void; + cutToEndOfLine(options?: ReadonlyEditOptions): void; /** * For each selection, if the selection is empty, cut all characters of the * containing buffer line following the cursor. Otherwise cut the selected text. */ - cutToEndOfBufferLine(): void; + cutToEndOfBufferLine(options?: ReadonlyEditOptions): void; // Folds /** @@ -3322,7 +3325,7 @@ export class Directory { /** Returns a boolean, always false. */ isFile(): this is File; - /** Returns a roolean, always true. */ + /** Returns a boolean, always true. */ isDirectory(): this is Directory; /** Returns a boolean indicating whether or not this is a symbolic link. */ @@ -4482,6 +4485,10 @@ export interface Project { /** Invoke a callback when a filesystem change occurs within any open project path. */ onDidChangeFiles(callback: (events: FilesystemChangeEvent) => void): Disposable; + /** Invoke a callback whenever the project's configuration has been replaced. */ + onDidReplace(callback: (projectSpec: ProjectSpecification | null | undefined) => void): + Disposable; + // Accessing the Git Repository /** * Get an Array of GitRepositorys associated with the project's directories. @@ -4716,107 +4723,107 @@ export interface Selection { // Modifying the selected text /** Replaces text at the current selection. */ - insertText(text: string, options?: TextInsertionOptions): void; + insertText(text: string, options?: TextInsertionOptions & ReadonlyEditOptions): void; /** * Removes the first character before the selection if the selection is empty * otherwise it deletes the selection. */ - backspace(): void; + backspace(options?: ReadonlyEditOptions): void; /** * Removes the selection or, if nothing is selected, then all characters from * the start of the selection back to the previous word boundary. */ - deleteToPreviousWordBoundary(): void; + deleteToPreviousWordBoundary(options?: ReadonlyEditOptions): void; /** * Removes the selection or, if nothing is selected, then all characters from * the start of the selection up to the next word boundary. */ - deleteToNextWordBoundary(): void; + deleteToNextWordBoundary(options?: ReadonlyEditOptions): void; /** * Removes from the start of the selection to the beginning of the current * word if the selection is empty otherwise it deletes the selection. */ - deleteToBeginningOfWord(): void; + deleteToBeginningOfWord(options?: ReadonlyEditOptions): void; /** * Removes from the beginning of the line which the selection begins on all * the way through to the end of the selection. */ - deleteToBeginningOfLine(): void; + deleteToBeginningOfLine(options?: ReadonlyEditOptions): void; /** * Removes the selection or the next character after the start of the selection * if the selection is empty. */ - delete(): void; + delete(options?: ReadonlyEditOptions): void; /** * If the selection is empty, removes all text from the cursor to the end of * the line. If the cursor is already at the end of the line, it removes the following * newline. If the selection isn't empty, only deletes the contents of the selection. */ - deleteToEndOfLine(): void; + deleteToEndOfLine(options?: ReadonlyEditOptions): void; /** * Removes the selection or all characters from the start of the selection to * the end of the current word if nothing is selected. */ - deleteToEndOfWord(): void; + deleteToEndOfWord(options?: ReadonlyEditOptions): void; /** * Removes the selection or all characters from the start of the selection to * the end of the current word if nothing is selected. */ - deleteToBeginningOfSubword(): void; + deleteToBeginningOfSubword(options?: ReadonlyEditOptions): void; /** * Removes the selection or all characters from the start of the selection to * the end of the current word if nothing is selected. */ - deleteToEndOfSubword(): void; + deleteToEndOfSubword(options?: ReadonlyEditOptions): void; /** Removes only the selected text. */ - deleteSelectedText(): void; + deleteSelectedText(options?: ReadonlyEditOptions): void; /** * Removes the line at the beginning of the selection if the selection is empty * unless the selection spans multiple lines in which case all lines are removed. */ - deleteLine(): void; + deleteLine(options?: ReadonlyEditOptions): void; /** * Joins the current line with the one below it. Lines will be separated by a single space. * If there selection spans more than one line, all the lines are joined together. */ - joinLines(): void; + joinLines(options?: ReadonlyEditOptions): void; /** Removes one level of indent from the currently selected rows. */ - outdentSelectedRows(): void; + outdentSelectedRows(options?: ReadonlyEditOptions): void; /** * Sets the indentation level of all selected rows to values suggested by the * relevant grammars. */ - autoIndentSelectedRows(): void; + autoIndentSelectedRows(options?: ReadonlyEditOptions): void; /** * Wraps the selected lines in comments if they aren't currently part of a comment. * Removes the comment if they are currently wrapped in a comment. */ - toggleLineComments(): void; + toggleLineComments(options?: ReadonlyEditOptions): void; /** Cuts the selection until the end of the screen line. */ - cutToEndOfLine(): void; + cutToEndOfLine(maintainClipboard?: boolean, options?: ReadonlyEditOptions): void; /** Cuts the selection until the end of the buffer line. */ - cutToEndOfBufferLine(): void; + cutToEndOfBufferLine(maintainClipboard?: boolean, options?: ReadonlyEditOptions): void; /** Copies the selection to the clipboard and then deletes it. */ - cut(maintainClipboard?: boolean, fullLine?: boolean): void; + cut(maintainClipboard?: boolean, fullLine?: boolean, options?: ReadonlyEditOptions): void; /** Copies the current selection to the clipboard. */ copy(maintainClipboard?: boolean, fullLine?: boolean): void; @@ -4825,7 +4832,7 @@ export interface Selection { fold(): void; /** If the selection spans multiple rows, indent all of them. */ - indentSelectedRows(): void; + indentSelectedRows(options?: ReadonlyEditOptions): void; // Managing multiple selections /** Moves the selection down one row. */ @@ -5134,6 +5141,12 @@ export class TextBuffer { */ nextNonBlankRow(startRow: number): number|null; + /** + * Return true if the buffer contains any astral-plane Unicode characters that + * are encoded as surrogate pairs. + */ + hasAstral(): boolean; + // Mutating Text /** Replace the entire contents of the buffer with the given text. */ setText(text: string): Range; @@ -5172,7 +5185,7 @@ export class TextBuffer { // Markers /** Create a layer to contain a set of related markers. */ - addMarkerLayer(options?: { maintainHistory?: boolean, persistent?: boolean }): + addMarkerLayer(options?: { maintainHistory?: boolean, persistent?: boolean, role?: string }): MarkerLayer; /** @@ -5210,16 +5223,18 @@ export class TextBuffer { * Undo the last operation. If a transaction is in progress, aborts it. * @return A boolean of whether or not a change was made. */ - undo(): boolean; + undo(options?: HistoryTraversalOptions): boolean; /** * Redo the last operation. * @return A boolean of whether or not a change was made. */ - redo(): boolean; + redo(options?: HistoryTraversalOptions): boolean; /** Batch multiple operations as a single undo/redo step. */ - transact(groupingInterval: number, fn: () => T): T; + transact(optionsOrInterval: number | { groupingInterval?: number } & + HistoryTransactionOptions, fn: () => T): T; + /** Batch multiple operations as a single undo/redo step. */ transact(fn: () => T): T; /** @@ -5237,20 +5252,21 @@ export class TextBuffer { * `::revertToCheckpoint` and `::groupChangesSinceCheckpoint`. * @return A checkpoint ID value. */ - createCheckpoint(): number; + createCheckpoint(options?: HistoryTransactionOptions): number; /** * Revert the buffer to the state it was in when the given checkpoint was created. * @return A boolean indicating whether the operation succeeded. */ - revertToCheckpoint(checkpoint: number): boolean; + revertToCheckpoint(checkpoint: number, options?: HistoryTraversalOptions): + boolean; /** * Group all changes since the given checkpoint into a single transaction for * purposes of undo/redo. * @return A boolean indicating whether the operation succeeded. */ - groupChangesSinceCheckpoint(checkpoint: number): boolean; + groupChangesSinceCheckpoint(checkpoint: number, options?: HistoryTransactionOptions): boolean; /** * Group the last two text changes for purposes of undo/redo. @@ -5828,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.26.0/src/config-schema.js +// https://github.com/atom/atom/blob/v1.27.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 @@ -6356,6 +6372,16 @@ export interface FindMarkerOptions { intersectsRow?: number; } +export interface HistoryTransactionOptions { + /** When provided, skip taking snapshot for other selections markerLayers except given one. */ + selectionsMarkerLayer?: MarkerLayer; +} + +export interface HistoryTraversalOptions { + /** Restore snapshot of selections marker layer to given selectionsMarkerLayer. */ + selectionsMarkerLayer?: MarkerLayer; +} + export interface MenuOptions { /** The menu itme's label. */ label: string; @@ -6413,6 +6439,11 @@ export interface ProcessOptions extends NodeProcessOptions { autoStart?: boolean; } +export interface ReadonlyEditOptions { + /** Whether the readonly protections on the text editor should be ignored. */ + bypassReadOnly?: boolean; +} + export interface ScanContextOptions { /** The number of lines before the matched line to include in the results object. */ leadingContextLineCount?: number; @@ -6822,6 +6853,12 @@ export interface ProjectHistory { lastOpened: Date; } +export interface ProjectSpecification { + paths: string[]; + originPath: string; + config?: ConfigValues; +} + export interface ScandalResult { filePath: string; matches: Array<{ diff --git a/types/auth0/index.d.ts b/types/auth0/index.d.ts index 516e2cc368..aa82e908e5 100644 --- a/types/auth0/index.d.ts +++ b/types/auth0/index.d.ts @@ -33,8 +33,13 @@ export interface RetryOptions { maxRetries?: number; } -export interface UserMetadata { } -export interface AppMetadata { } +export interface UserMetadata { + [propName: string]: string +} + +export interface AppMetadata { + [propName: string]: any +} export interface UserData { email?: string; @@ -513,9 +518,72 @@ export interface EmailVerificationTicketOptions { result_url: string; } +export interface BaseClientOptions { + baseUrl: string; + clientId?: string; +} + +export interface OAuthClientOptions extends BaseClientOptions { + clientSecret?: string; +} + +export interface DatabaseClientOptions extends BaseClientOptions { +} + +export interface PasswordLessClientOptions extends BaseClientOptions { +} + +export interface TokenManagerOptions extends BaseClientOptions { + headers?: any; +} +export interface UsersOptions extends BaseClientOptions { + headers?: any; +} + +export interface SignInOptions extends VerifyOptions { + connection?: string; +} + +export interface SocialSignInOptions { + access_token: string; + connection: string; +} + +export interface SignInToken { + access_token: string; + id_token?: string; + token_type?: string; + expiry: number; +} + +export interface RequestSMSCodeOptions extends RequestSMSOptions { + client_id: string; +} + +export type SendType = 'link' | 'code'; +export interface RequestEmailCodeOrLinkOptions { + email: string; + send: SendType +} + +export interface ImpersonateSettingOptions { + impersonator_id: string; + protocol: string; + token: string; + clientId?: string; +} + export class AuthenticationClient { + + // Members + database?: DatabaseAuthenticator; + oauth?: OAuthAuthenticator; + passwordless?: PasswordlessAuthenticator; + tokens?: TokenManager; + users?: UsersManager; + constructor(options: AuthenticationClientOptions); getClientInfo(): ClientInfo; @@ -755,3 +823,63 @@ export class ManagementClient { updateResourceServer(params: ObjectWithId, data: ResourceServer): Promise; updateResourceServer(params: ObjectWithId, data: ResourceServer, cb?: (err: Error, data: ResourceServer) => void): void; } + + +export class DatabaseAuthenticator { + constructor(options: DatabaseClientOptions, oauth: OAuthAuthenticator); + + changePassword(data: ResetPasswordOptions): Promise; + changePassword(data: ResetPasswordOptions, cb: (err: Error, message: string) => void): void; + + requestChangePasswordEmail(data: ResetPasswordEmailOptions): Promise; + requestChangePasswordEmail(data: ResetPasswordEmailOptions, cb: (err: Error, message: string) => void): void; + + signIn(data: SignInOptions): Promise; + signIn(data: SignInOptions, cb: (err: Error, data: SignInToken) => void): void; + + signUp(data: CreateUserData): Promise; + signIn(data: CreateUserData, cb: (err: Error, data: User) => void): void; + +} + +export class OAuthAuthenticator { + constructor(options: OAuthClientOptions); + + passwordGrant(options: PasswordGrantOptions): Promise; + passwordGrant(options: PasswordGrantOptions, cb: (err: Error, response: SignInToken) => void): void; + + signIn(data: SignInOptions): Promise; + signIn(data: SignInOptions, cb: (err: Error, data: SignInToken) => void): void; + + + socialSignIn(data: SocialSignInOptions): Promise; + socialSignIn(data: SocialSignInOptions, cb: (err: Error, data: SignInToken) => void): void; +} + +export class PasswordlessAuthenticator { + constructor(options: PasswordLessClientOptions, oauth: OAuthAuthenticator); + + signIn(data: SignInOptions): Promise; + signIn(data: SignInOptions, cb: (err: Error, data: SignInToken) => void): void; + + sendEmail(data: RequestEmailCodeOrLinkOptions): Promise; + sendEmail(data: RequestEmailCodeOrLinkOptions, cb: (err: Error, message: string) => void): void; + + sendSMS(data: RequestSMSCodeOptions): Promise; + sendSMS(data: RequestSMSCodeOptions, cb: (err: Error, message: string) => void): void; +} + +export class TokenManager { + constructor(options: TokenManagerOptions); + +} + +export class UsersManager { + constructor(options: UsersOptions); + + getInfo(accessToken: string): Promise; + getInfo(accessToken: string, cb: (err: Error, user: User) => void): void; + + 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/awesomplete/index.d.ts b/types/awesomplete/index.d.ts index e73b7cf2f3..9f5060de03 100644 --- a/types/awesomplete/index.d.ts +++ b/types/awesomplete/index.d.ts @@ -42,7 +42,8 @@ declare class Awesomplete { } declare namespace Awesomplete { - type Suggestion = string | {label: string | any, value: string | any} | [string, string]; + type Suggestion = string | { label: string | any, value: string | any } | [string, string]; + type SortFunction = (left: number | any[], right: number | any[]) => number; interface Options { list?: string | string[] | Element | Array<{ label: string, value: any }> | Array<[string, string]>; @@ -51,7 +52,7 @@ declare namespace Awesomplete { autoFirst?: boolean; data?(item: Suggestion, input: string): string; filter?(text: string, input: string): boolean; - sort?(left: number | any[], right: number | any[]): number; + sort?: boolean | SortFunction; item?(text: string, input: string): HTMLElement; replace?(text: string): void; } diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index 9f9d7438e3..d3e630ddf1 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -93,6 +93,7 @@ str = apiGwEvtReqCtx.identity.sourceIp; strOrNull = apiGwEvtReqCtx.identity.user; strOrNull = apiGwEvtReqCtx.identity.userAgent; strOrNull = apiGwEvtReqCtx.identity.userArn; +str = apiGwEvtReqCtx.path; str = apiGwEvtReqCtx.stage; str = apiGwEvtReqCtx.requestId; str = apiGwEvtReqCtx.resourceId; @@ -503,6 +504,7 @@ function callback(cb: AWSLambda.Callback) { cb(); cb(null); cb(error); + cb(str); // https://docs.aws.amazon.com/apigateway/latest/developerguide/handle-errors-in-lambda-integration.html cb(null, anyObj); cb(null, bool); cb(null, str); @@ -525,6 +527,58 @@ function customAuthorizerCallback(cb: AWSLambda.CustomAuthorizerCallback) { cb(null, authResponse); } +/* CodePipeline events https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html#actions-invoke-lambda-function-json-event-example */ +const CodePipelineEvent: AWSLambda.CodePipelineEvent = { + "CodePipeline.job": { + id: "11111111-abcd-1111-abcd-111111abcdef", + accountId: "111111111111", + data: { + actionConfiguration: { + configuration: { + FunctionName: "MyLambdaFunctionForAWSCodePipeline", + UserParameters: "some-input-such-as-a-URL" + } + }, + inputArtifacts: [ + { + location: { + s3Location: { + bucketName: "the name of the bucket configured as the pipeline artifact store in Amazon S3, for example codepipeline-us-east-2-1234567890", + objectKey: "the name of the application, for example CodePipelineDemoApplication.zip" + }, + type: "S3" + }, + revision: null, + name: "ArtifactName" + } + ], + outputArtifacts: [], + artifactCredentials: { + secretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", + sessionToken: `MIICiTCCAfICCQD6m7oRw0uXOjANBgkqhkiG9w + 0BAQUFADCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZ + WF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIw + EAYDVQQDEwlUZXN0Q2lsYWMxHzAdBgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5 + jb20wHhcNMTEwNDI1MjA0NTIxWhcNMTIwNDI0MjA0NTIxWjCBiDELMAkGA1UEBh + MCVVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBb + WF6b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMx + HzAdBgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wgZ8wDQYJKoZIhvcNAQE + BBQADgY0AMIGJAoGBAMaK0dn+a4GmWIWJ21uUSfwfEvySWtC2XADZ4nB+BLYgVI + k60CpiwsZ3G93vUEIO3IyNoH/f0wYK8m9TrDHudUZg3qX4waLG5M43q7Wgc/MbQ + ITxOUSQv7c7ugFFDzQGBzZswY6786m86gpEIbb3OhjZnzcvQAaRHhdlQWIMm2nr + AgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAtCu4nUhVVxYUntneD9+h8Mg9q6q+auN + KyExzyLwaxlAoo7TJHidbtS4J5iNmZgXL0FkbFFBjvSfpJIlJ00zbhNYS5f6Guo + EDmFJl0ZxBHjJnyp378OD8uTs7fLvjx79LjSTbNYiytVbZPQUQ5Yaxu2jXnimvw + 3rrszlaEXAMPLE=`, + accessKeyId: "AKIAIOSFODNN7EXAMPLE" + }, + continuationToken: "A continuation token if continuing job" + } + } +}; + +CodePipelineEvent["CodePipeline.job"].data.encryptionKey = { type: 'KMS', id: 'key' }; + /* CloudFront events, see http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html */ const CloudFrontRequestEvent: AWSLambda.CloudFrontRequestEvent = { Records: [ @@ -750,6 +804,8 @@ let apiGtwProxyHandler: AWSLambda.APIGatewayProxyHandler = (event: AWSLambda.API let 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) => {}; + let cloudFrontRequestHandler: AWSLambda.CloudFrontRequestHandler = (event: AWSLambda.CloudFrontRequestEvent, context: AWSLambda.Context, cb: AWSLambda.CloudFrontRequestCallback) => { cb(); cb(null); diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index 7795c4cdfe..dd3fd3bd4e 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -18,6 +18,7 @@ // David Hayden // Chris Redekop // Aneil Mallavarapu +// Jeremy Nagel // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -42,6 +43,7 @@ export interface APIGatewayEventRequestContext { userAgent: string | null; userArn: string | null; }; + path: string; stage: string; requestId: string; requestTimeEpoch: number; @@ -501,6 +503,58 @@ export interface AuthResponseContext { [name: string]: any; } +/** + * CodePipeline events + * https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html + */ +export interface S3ArtifactLocation { + bucketName: string; + objectKey: string; +} +export interface S3ArtifactStore { + type: 'S3'; + s3Location: S3ArtifactLocation; +} + +export type ArtifactLocation = S3ArtifactStore; + +export interface Artifact { + name: string; + revision: string | null; + location: ArtifactLocation; +} + +export interface Credentials { + accessKeyId: string; + secretAccessKey: string; + sessionToken?: string; +} + +export interface EncryptionKey { + type: string; + id: string; +} + +export interface CodePipelineEvent { + "CodePipeline.job": { + id: string; + accountId: string; + data: { + actionConfiguration: { + configuration: { + FunctionName: string; + UserParameters: string; + } + }; + inputArtifacts: Artifact[]; + outputArtifacts: Artifact[]; + artifactCredentials: Credentials; + encryptionKey?: EncryptionKey & {type: 'KMS'}; + continuationToken?: string; + }; + }; +} + /** * CloudFront events * http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html @@ -608,9 +662,11 @@ export type Handler = ( * http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html * * @param error – an optional parameter that you can use to provide results of the failed Lambda function execution. + * It can be a string for Lambda Proxy Integrations + * https://docs.aws.amazon.com/apigateway/latest/developerguide/handle-errors-in-lambda-integration.html * @param result – an optional parameter that you can use to provide the result of a successful function execution. The result provided must be JSON.stringify compatible. */ -export type Callback = (error?: Error | null, result?: TResult) => void; +export type Callback = (error?: Error | null | string, result?: TResult) => void; // Begin defining Handler and Callback types for each API trigger type. // Ordered by https://docs.aws.amazon.com/lambda/latest/dg/invoking-lambda-function.html @@ -653,6 +709,8 @@ export type ProxyCallback = APIGatewayProxyCallback; // Old name // TODO: IoT +export type CodePipelineHandler = Handler; + export type CloudFrontRequestHandler = Handler; export type CloudFrontRequestCallback = Callback; diff --git a/types/axe-webdriverjs/axe-webdriverjs-tests.ts b/types/axe-webdriverjs/axe-webdriverjs-tests.ts new file mode 100644 index 0000000000..47eeadc8c5 --- /dev/null +++ b/types/axe-webdriverjs/axe-webdriverjs-tests.ts @@ -0,0 +1,31 @@ +import { Result, RunOptions, Spec } from "axe-core"; +import { AxeBuilder, AxeAnalysis } from "axe-webdriverjs"; +import { WebDriver } from "selenium-webdriver"; + +const inTest = async (webDriver: WebDriver) => { + const builderCalled: AxeBuilder = AxeBuilder(webDriver); + const builderNewed: AxeBuilder = new AxeBuilder(webDriver); + + const runOptions: RunOptions = {}; + const spec: Spec = {}; + + const analysis: AxeAnalysis = await AxeBuilder(webDriver) + .include("include") + .exclude("exclude") + .options(runOptions) + .withRules("rule") + .withRules(["rule", "rule"]) + .withTags("tag") + .withTags(["tag", "tag"]) + .disableRules("rule") + .disableRules(["rule", "rule"]) + .configure(spec) + .analyze((internalResults: AxeAnalysis) => {}); + + const inapplicable: Result[] = analysis.inapplicable; + const incomplete: Result[] = analysis.incomplete; + const passes: Result[] = analysis.passes; + const timestamp: string = analysis.timestamp; + const url: string = analysis.url; + const violations: Result[] = analysis.violations; +}; diff --git a/types/axe-webdriverjs/index.d.ts b/types/axe-webdriverjs/index.d.ts new file mode 100644 index 0000000000..3c8ae27249 --- /dev/null +++ b/types/axe-webdriverjs/index.d.ts @@ -0,0 +1,83 @@ +// Type definitions for axe-webdriverjs 2.0 +// Project: https://github.com/dequelabs/axe-webdriverjs#readme +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Result, RunOptions, Spec } from "axe-core"; +import { WebDriver } from "selenium-webdriver"; + +export interface AxeAnalysis { + inapplicable: Result[]; + incomplete: Result[]; + passes: Result[]; + timestamp: string; + url: string; + violations: Result[]; +} + +export interface AxeBuilder { + /** + * Includes a selector in analysis. + * + * @param selector CSS selector of the element to include. + */ + include(selector: string): this; + + /** + * Excludes a selector from analysis. + * + * @param selector CSS selector of the element to exclude. + */ + exclude(selector: string): this; + + /** + * Options to directly pass to `axe.run`. + * + * @param options aXe options object. + * @remarks Will override any other configured options, including calls to `withRules` and `withTags`. + * @see https://github.com/dequelabs/axe-core/issues/937 + */ + options(options: RunOptions): this; + + /** + * Limits analysis to only the specified rules. + * + * @param rules Array of rule IDs, or a single rule ID as a string. + * @remarks Cannot be used with `withTags`. + */ + withRules(rules: string | string[]): this; + + /** + * Limist analysis to only the specified tags. + * + * @param rules Array of tags, or a single tag as a string. + * @remarks Cannot be used with `withRules`. + */ + withTags(tags: string | string[]): this; + + /** + * Set the list of rules to skip when running an analysis + * + * @param rules Array of rule IDs, or a single rule ID as a string. + */ + disableRules(rules: string | string[]): this; + + /** + * Configures aXe before running analyze. + * + * @param config aXe Configuration spec to use in analysis. + */ + configure(config: Spec): this; + + /** + * Perform analysis and retrieve results. + * @param callback Function to execute when analysis completes. + */ + analyze(callback: (results: AxeAnalysis) => void): Promise; +} + +export const AxeBuilder: { + (driver: WebDriver): AxeBuilder; + new (driver: WebDriver): AxeBuilder; +}; diff --git a/types/activex-iwshruntimelibrary/package.json b/types/axe-webdriverjs/package.json similarity index 61% rename from types/activex-iwshruntimelibrary/package.json rename to types/axe-webdriverjs/package.json index d9b1031263..e4e88ef33a 100644 --- a/types/activex-iwshruntimelibrary/package.json +++ b/types/axe-webdriverjs/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "activex-helpers": "*" + "axe-core": "^3.0.3" } -} \ No newline at end of file +} diff --git a/types/axe-webdriverjs/tsconfig.json b/types/axe-webdriverjs/tsconfig.json new file mode 100644 index 0000000000..d8637d03e4 --- /dev/null +++ b/types/axe-webdriverjs/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", + "axe-webdriverjs-tests.ts" + ] +} diff --git a/types/axe-webdriverjs/tslint.json b/types/axe-webdriverjs/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/axe-webdriverjs/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/axios-token-interceptor/axios-token-interceptor-tests.ts b/types/axios-token-interceptor/axios-token-interceptor-tests.ts new file mode 100644 index 0000000000..036223b699 --- /dev/null +++ b/types/axios-token-interceptor/axios-token-interceptor-tests.ts @@ -0,0 +1,18 @@ +import tokenProvider = require('axios-token-interceptor'); + +tokenProvider(); // $ExpectError + +const validOptions = { + getToken: () => Promise.resolve('qwerty'), +}; +tokenProvider(validOptions); // $ExpectType TokenProvider + +tokenCache(); // $ExpectError + +const getToken = Promise.resolve('qwerty'); +const validCacheOptions = { + maxAge: 3600, +}; +const cache = tokenProvider.tokenCache(getToken, validCacheOptions); // $Expect TokenCache + +cache.reset(); // $ExpectType void diff --git a/types/axios-token-interceptor/index.d.ts b/types/axios-token-interceptor/index.d.ts new file mode 100644 index 0000000000..85121f8165 --- /dev/null +++ b/types/axios-token-interceptor/index.d.ts @@ -0,0 +1,32 @@ +// Type definitions for axios-token-interceptor 0.1 +// Project: https://github.com/sandrinodimattia/axios-token-interceptor#readme +// Definitions by: Mike Dodge +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { AxiosRequestConfig } from 'axios'; + +// Module +declare function AxiosTokenProvider(Options: AxiosTokenProvider.InterceptorOptions): AxiosTokenProvider.TokenProvider; +declare namespace AxiosTokenProvider { + function tokenCache(getToken: Promise, options: TokenCacheOptions): TokenCache; + + // Interfaces + interface InterceptorOptions { + token?: string; + getToken?: () => string | Promise; + header?: string; + headerFormatter?: (token: string) => string; + } + + type TokenProvider = (config: AxiosRequestConfig) => Promise; + + interface TokenCacheOptions { + getMaxAge?: () => number; + maxAge?: number; + } + + interface TokenCache { + reset(): void; + } +} +export = AxiosTokenProvider; diff --git a/types/react-monaco-editor/package.json b/types/axios-token-interceptor/package.json similarity index 60% rename from types/react-monaco-editor/package.json rename to types/axios-token-interceptor/package.json index c30b05905b..4f244abbfd 100644 --- a/types/react-monaco-editor/package.json +++ b/types/axios-token-interceptor/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "monaco-editor": "^0.10.0" + "axios": "*" } } diff --git a/types/axios-token-interceptor/tsconfig.json b/types/axios-token-interceptor/tsconfig.json new file mode 100644 index 0000000000..509608e7d6 --- /dev/null +++ b/types/axios-token-interceptor/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", + "axios-token-interceptor-tests.ts" + ] +} diff --git a/types/axios-token-interceptor/tslint.json b/types/axios-token-interceptor/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/axios-token-interceptor/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/babel-core/babel-core-tests.ts b/types/babel-core/babel-core-tests.ts index b3839d151f..da87d891ba 100644 --- a/types/babel-core/babel-core-tests.ts +++ b/types/babel-core/babel-core-tests.ts @@ -1,13 +1,15 @@ import * as babel from "babel-core"; -// Example from https://github.com/babel/babel/tree/master/packages/babel-core +// Slightly modified example from https://github.com/babel/babel/tree/master/packages/babel-core const code = `class Example {}`; const result = babel.transform(code, { /* options */ }); result.code; // Generated code result.map; // Sourcemap result.ast; // AST +result.ignored; +result.metadata; -// Examples from http://babeljs.io/docs/usage/api/ +// Slightly modified examples from http://babeljs.io/docs/usage/api/ const options: babel.TransformOptions = { plugins: [ "es2015-arrow-functions", @@ -24,6 +26,8 @@ babel.transformFile("filename.js", options, (err, result) => { result.code; result.map; result.ast; + result.ignored; + result.metadata; }); babel.transformFileSync("filename.js", options).code; diff --git a/types/babel-core/index.d.ts b/types/babel-core/index.d.ts index 3a41d2d252..3a6da1b49d 100644 --- a/types/babel-core/index.d.ts +++ b/types/babel-core/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Troy Gerwien // Marvin Hagemeister // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as t from 'babel-types'; export { t as types }; @@ -169,9 +169,30 @@ export interface TransformOptions { wrapPluginVisitorMethod?(pluginAlias: string, visitorType: 'enter' | 'exit', callback: (path: NodePath, state: any) => void): (path: NodePath, state: any) => void ; } +export interface BabelFileModulesMetadata { + imports: object[]; + exports: { + exported: object[], + specifiers: object[] + }; +} + +export interface BabelFileMetadata { + usedHelpers: string[]; + marked: Array<{ + type: string; + message: string; + loc: object; + }>; + modules: BabelFileModulesMetadata; +} + export interface BabelFileResult { ast?: Node; code?: string; + ignored?: boolean; map?: object; + metadata?: BabelFileMetadata; } + export as namespace babel; diff --git a/types/babel-generator/index.d.ts b/types/babel-generator/index.d.ts index 2e34d158fc..8afeca4cd1 100644 --- a/types/babel-generator/index.d.ts +++ b/types/babel-generator/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Troy Gerwien // Johnny Estilles // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as t from 'babel-types'; diff --git a/types/babel-template/index.d.ts b/types/babel-template/index.d.ts index 467b0193e7..50b759c3f5 100644 --- a/types/babel-template/index.d.ts +++ b/types/babel-template/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Troy Gerwien // Marvin Hagemeister // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import { BabylonOptions } from 'babylon'; import * as t from 'babel-types'; diff --git a/types/babel-traverse/index.d.ts b/types/babel-traverse/index.d.ts index df420c17bd..5c18c3ff29 100644 --- a/types/babel-traverse/index.d.ts +++ b/types/babel-traverse/index.d.ts @@ -2,15 +2,17 @@ // Project: https://github.com/babel/babel/tree/master/packages/babel-traverse // Definitions by: Troy Gerwien // Marvin Hagemeister +// Ryan Petrich // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// 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?: any, parentPath?: NodePath): void; +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 { +export interface TraverseOptions extends Visitor { scope?: Scope; noScope?: boolean; } @@ -25,6 +27,7 @@ export class Scope { 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. */ @@ -339,10 +342,10 @@ export class NodePath { listKey: string; inList: boolean; parentKey: string; - key: string; + key: string | number; node: T; scope: Scope; - type: string; + type: T extends undefined | null ? string | null : string; typeAnnotation: object; getScope(scope: Scope): Scope; @@ -353,7 +356,8 @@ export class NodePath { buildCodeFrameError(msg: string, Error?: new (msg: string) => TError): TError; - traverse(visitor: Visitor, state?: any): void; + traverse(visitor: Visitor, state: T): void; + traverse(visitor: Visitor): void; set(key: string, node: Node): void; @@ -372,10 +376,10 @@ export class NodePath { find(callback: (path: NodePath) => boolean): NodePath; /** Get the parent function of the current path. */ - getFunctionParent(): NodePath; + getFunctionParent(): NodePath; /** Walk up the tree until we hit a parent node path in a list. */ - getStatementParent(): NodePath; + getStatementParent(): NodePath; /** * Get the deepest common ancestor and then from it, get the earliest relationship path @@ -537,6 +541,9 @@ export class NodePath { /** 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; @@ -582,9 +589,15 @@ export class NodePath { getCompletionRecords(): NodePath[]; - getSibling(key: string): NodePath; + getSibling(key: string | number): NodePath; + getAllPrevSiblings(): NodePath[]; + getAllNextSiblings(): NodePath[]; - get(key: string, context?: boolean | TraversalContext): 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[]; diff --git a/types/babel-types/index.d.ts b/types/babel-types/index.d.ts index b1de338923..47068c3481 100644 --- a/types/babel-types/index.d.ts +++ b/types/babel-types/index.d.ts @@ -5,7 +5,7 @@ // Marvin Hagemeister // Boris Cherny // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 export interface Comment { value: string; @@ -46,7 +46,7 @@ export interface Node { export interface ArrayExpression extends Node { type: "ArrayExpression"; - elements: Array; + elements: Array; } export interface AssignmentExpression extends Node { @@ -1306,7 +1306,7 @@ export type TSEntityName = Identifier | TSQualifiedName; export type TSTypeElement = TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSIndexSignature | TSMethodSignature | TSPropertySignature; -export function arrayExpression(elements?: Array): ArrayExpression; +export function arrayExpression(elements?: Array): ArrayExpression; export function assignmentExpression(operator?: string, left?: LVal, right?: Expression): AssignmentExpression; export function binaryExpression( operator?: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<=", diff --git a/types/babel-webpack-plugin/index.d.ts b/types/babel-webpack-plugin/index.d.ts index 3f16d154ac..6f85bae2cc 100644 --- a/types/babel-webpack-plugin/index.d.ts +++ b/types/babel-webpack-plugin/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/simlrh/babel-webpack-plugin // Definitions by: Jed Fox // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import { Plugin } from 'webpack'; import { TransformOptions } from 'babel-core'; diff --git a/types/babelify/index.d.ts b/types/babelify/index.d.ts index f394d2ba44..ca90ae9d4c 100644 --- a/types/babelify/index.d.ts +++ b/types/babelify/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: TeamworkGuy2 // Marvin Hagemeister // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// diff --git a/types/babylon-walk/index.d.ts b/types/babylon-walk/index.d.ts index 02c3f39d10..43c9c1bf3a 100644 --- a/types/babylon-walk/index.d.ts +++ b/types/babylon-walk/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/pugjs/babylon-walk // Definitions by: Marek Buchar // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import * as babelTypes from 'babel-types'; diff --git a/types/babylon/index.d.ts b/types/babylon/index.d.ts index eb22f30c13..07eb74bb32 100644 --- a/types/babylon/index.d.ts +++ b/types/babylon/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Troy Gerwien // Marvin Hagemeister // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 import { File, Expression } from 'babel-types'; diff --git a/types/backbone.marionette/backbone.marionette-tests.ts b/types/backbone.marionette/backbone.marionette-tests.ts index f57e9e2edc..c6400b2672 100644 --- a/types/backbone.marionette/backbone.marionette-tests.ts +++ b/types/backbone.marionette/backbone.marionette-tests.ts @@ -1,3 +1,4 @@ +import * as JQuery from 'jquery'; import * as Marionette from 'backbone.marionette'; import * as Backbone from 'backbone'; @@ -9,6 +10,10 @@ class DestroyWarn extends Marionette.Behavior { message: 'you are destroying!' }; + ui = { + destroy: '.foo' + }; + // behaviors have events that are bound to the views DOM events = { 'click @ui.destroy': 'warnBeforeDestroy' @@ -258,12 +263,18 @@ function RegionTests() { }); } +function BehaviorTest() { + const b = new DestroyWarn(); + const uiHandle: JQuery = b.getUI('destroy'); +} + function ViewTests() { const v = new MyView(new MyModel()); const isDestroyed: boolean = v.isDestroyed(); const isRendered: boolean = v.isRendered(); const isAttached: boolean = v.isAttached(); const vv: Marionette.View = v.delegateEntityEvents(); + const uiHandle: JQuery = v.getUI('destroy'); } function CollectionViewTests() { diff --git a/types/backbone.marionette/index.d.ts b/types/backbone.marionette/index.d.ts index 7626d60d56..0b717c9bb1 100644 --- a/types/backbone.marionette/index.d.ts +++ b/types/backbone.marionette/index.d.ts @@ -1143,6 +1143,11 @@ export class View extends Backbone.View i * throughout the view with the ui attribute. */ ui: any; + + /** + * Get handle on UI element defined in ui hash + */ + getUI(ui: string): JQuery; } export interface CollectionViewOptions< @@ -1561,6 +1566,11 @@ export class Behavior extends Object { */ ui: any; + /** + * Get handle on UI element defined in ui hash + */ + getUI(ui: string): JQuery; + /** * Any triggers you define on the Behavior will be triggered in response to the appropriate event on the view. */ diff --git a/types/backo2/backo2-tests.ts b/types/backo2/backo2-tests.ts new file mode 100644 index 0000000000..71b20378d2 --- /dev/null +++ b/types/backo2/backo2-tests.ts @@ -0,0 +1,13 @@ +import Backoff = require("backo2"); + +const backoff = new Backoff(); +const backoff2 = new Backoff({}); +const backoff3 = new Backoff({ + min: 0, + max: 0, + jitter: 0, + factor: 0 +}); + +const y: number = backoff3.duration(); +backoff3.reset(); diff --git a/types/backo2/index.d.ts b/types/backo2/index.d.ts new file mode 100644 index 0000000000..9dcaba9f2a --- /dev/null +++ b/types/backo2/index.d.ts @@ -0,0 +1,36 @@ +// Type definitions for backo2 1.0 +// Project: https://github.com/mokesmokes/backo +// Definitions by: Retsam +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +type BackoffOptions = Partial<{ + min: number, + max: number, + jitter: number, + factor: number, +}>; + +declare class Backoff { + constructor(opts?: BackoffOptions); + + duration(): number; + /** + * Reset the number of attempts. + */ + reset(): void; + /** + * Set the minimum duration + */ + setMin(min: number): void; + /** + * Set the maximum duration + */ + setMax(max: number): void; + /** + * Set the jitter + */ + setJitter(jitter: number): void; +} + +export = Backoff; diff --git a/types/backo2/tsconfig.json b/types/backo2/tsconfig.json new file mode 100644 index 0000000000..2abe4e6c11 --- /dev/null +++ b/types/backo2/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", + "backo2-tests.ts" + ] +} diff --git a/types/backo2/tslint.json b/types/backo2/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/backo2/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/bin-pack/bin-pack-tests.ts b/types/bin-pack/bin-pack-tests.ts new file mode 100644 index 0000000000..f913d53520 --- /dev/null +++ b/types/bin-pack/bin-pack-tests.ts @@ -0,0 +1,8 @@ +import * as pack from "bin-pack"; + +// $ExpectType PackResult<{ width: number; height: number; }> +const packResult = pack([ + { width: 50, height: 50 }, + { width: 25, height: 25 }, + { width: 25, height: 20 } +]); diff --git a/types/bin-pack/index.d.ts b/types/bin-pack/index.d.ts new file mode 100644 index 0000000000..0d3df98899 --- /dev/null +++ b/types/bin-pack/index.d.ts @@ -0,0 +1,60 @@ +// Type definitions for bin-pack 1.0 +// Project: https://github.com/bryanburgers/bin-pack +// Definitions by: Oren Trutner +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Packs objects that have a width and a height into as small of a square as + * possible, using a binary tree bin packing algorithm. After packing, each + * object is given an (x, y) coordinate of where it would be optimally packed. + * @param bins List of rectangular bins to pack + * @param options Packing options. Use inPlace: true to modify the bins + * argument in-place. + */ +declare function pack(bins: T[], options?: pack.Options): pack.PackResult; + +declare namespace pack { + /** Packing options. */ + interface Options { + /** Use inPlace=true to add x,y fields to the bins argument. */ + inPlace?: boolean; + } + + /** Specifies the dimensions of a bin to pack. */ + interface Bin { + width: number; + height: number; + } + + /** Describes the location of a packed bin. */ + interface PackedItem { + /** X coordinate of the packed bin. */ + x: number; + + /** Y coordinate of the packed bin. */ + y: number; + + /** Width of the bin. */ + width: number; + + /** Height of the bin. */ + height: number; + + /** The original bin object. */ + item: T; + } + + /** The return value from the pack function. */ + interface PackResult { + /** Width of the bounding box around all bins. */ + width: number; + + /** Height of the bounding box around all bins. */ + height: number; + + /** List of packed bins. */ + items: Array>; + } +} + +export = pack; diff --git a/types/bin-pack/tsconfig.json b/types/bin-pack/tsconfig.json new file mode 100644 index 0000000000..6c6a41a37a --- /dev/null +++ b/types/bin-pack/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", + "bin-pack-tests.ts" + ] +} diff --git a/types/bin-pack/tslint.json b/types/bin-pack/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/bin-pack/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts b/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts index 669c00d77a..9576ba7289 100644 --- a/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts +++ b/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts @@ -41,3 +41,22 @@ bitcoin.address.toBase58Check(rsBase58Check.hash, rsBase58Check.version); bitcoin.address.toBech32(rsBech32.data, rsBech32.version, rsBech32.prefix); bitcoin.address.toOutputScript(address); bitcoin.address.toOutputScript(address, network); + +const redeemScript = bitcoin.script.multisig.output.encode( + 2, + [ + new Buffer('12345678901234567890123456789012'), + new Buffer('12345678901234567890123456789012'), + new Buffer('12345678901234567890123456789012'), + ] +); +bitcoin.script.scriptHash.input.encode( + bitcoin.script.multisig.input.encodeStack( + [ + new Buffer('12345678901234567890123456789012'), + new Buffer('12345678901234567890123456789012'), + ], + redeemScript, + ), + redeemScript, +); diff --git a/types/bitcoinjs-lib/index.d.ts b/types/bitcoinjs-lib/index.d.ts index 920df43d6e..2d0603b87c 100644 --- a/types/bitcoinjs-lib/index.d.ts +++ b/types/bitcoinjs-lib/index.d.ts @@ -1,10 +1,11 @@ -// Type definitions for bitcoinjs-lib 3.3 +// Type definitions for bitcoinjs-lib 3.4 // Project: https://github.com/bitcoinjs/bitcoinjs-lib // Definitions by: Mohamed Hegazy // Daniel // Ron Buckton // Satana Charuwichitratana // Youssef GHOUBACH +// Kento // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Declaration file initially generated by dts-gen for bitcoinjs-lib 3.0.3 // based on the flow version found at https://github.com/flowtype/flow-typed/blob/master/definitions/npm/bitcoinjs-lib_v2.x.x/flow_v0.17.x-/bitcoinjs-lib_v2.x.x.js @@ -23,9 +24,11 @@ export interface In { hash: Buffer; index: number; sequence: number; + witness: Buffer[]; } export interface Network { + bech32?: string; bip32: { public: number; private: number; @@ -467,8 +470,8 @@ export namespace script { check(script: Buffer, allowIncomplete: boolean): boolean; decode(buffer: Buffer): Array; decodeStack(stack: Buffer[], allowIncomplete: boolean): Array; - encode(signatures: ECSignature[], scriptPubKey: Buffer): Buffer; - encodeStack(signatures: ECSignature[], scriptPubKey: Buffer): ECSignature[]; + encode(signatures: Buffer[], scriptPubKey: Buffer): Buffer; + encodeStack(signatures: Buffer[], scriptPubKey: Buffer): Buffer[]; }; output: { check(script: Buffer, allowIncomplete: boolean): boolean; @@ -482,8 +485,8 @@ export namespace script { check(script: Buffer): boolean; decode(buffer: Buffer): Array; decodeStack(stack: Buffer[]): Array; - encode(signature: ECSignature): Buffer; - encodeStack(signature: ECSignature): ECSignature[]; + encode(signature: Buffer): Buffer; + encodeStack(signature: Buffer): Buffer[]; }; output: { @@ -496,10 +499,10 @@ export namespace script { const pubKeyHash: { input: { check(script: Buffer): boolean; - decode(buffer: Buffer): { signature: ECSignature; pubKey: Buffer }; - decodeStack(stack: Buffer[]): { signature: ECSignature; pubKey: Buffer }; - encode(signature: ECSignature, pubKey: Buffer): Buffer; - encodeStack(signature: ECSignature, pubKey: Buffer): [ECSignature, Buffer]; + decode(buffer: Buffer): { signature: Buffer; pubKey: Buffer }; + decodeStack(stack: Buffer[]): { signature: Buffer; pubKey: Buffer }; + encode(signature: Buffer, pubKey: Buffer): Buffer; + encodeStack(signature: Buffer, pubKey: Buffer): [Buffer, Buffer]; }; output: { @@ -515,7 +518,7 @@ export namespace script { decode(buffer: Buffer): { redeemScriptStack: Buffer[]; redeemScript: Buffer }; decodeStack(stack: Buffer[]): { redeemScriptStack: Buffer[]; redeemScript: Buffer }; encode(redeemScriptSig: Array, redeemScript: Buffer): Buffer; - encodeStack(redeemScriptStack: Buffer[], redeemScript: Buffer): Buffer; + encodeStack(redeemScriptStack: Buffer[], redeemScript: Buffer): Buffer[]; }; output: { @@ -536,8 +539,8 @@ export namespace script { const witnessPubKeyHash: { input: { check(script: Buffer): boolean; - decodeStack(stack: Buffer[]): { signature: ECSignature; pubKey: Buffer }; - encodeStack(signature: ECSignature, pubKey: Buffer): [ECSignature, Buffer]; + decodeStack(stack: Buffer[]): { signature: Buffer; pubKey: Buffer }; + encodeStack(signature: Buffer, pubKey: Buffer): [Buffer, Buffer]; }; output: { @@ -551,7 +554,7 @@ export namespace script { input: { check(script: Buffer, allowIncomplete: boolean): boolean; decodeStack(stack: Buffer[]): { redeemScriptStack: Buffer[]; redeemScript: Buffer }; - encodeStack(redeemScriptStack: Buffer[], redeemScript: Buffer): Buffer; + encodeStack(redeemScriptStack: Buffer[], redeemScript: Buffer): Buffer[]; }; output: { diff --git a/types/bleno/bleno-tests.ts b/types/bleno/bleno-tests.ts index bd4b6971ee..2251baed19 100644 --- a/types/bleno/bleno-tests.ts +++ b/types/bleno/bleno-tests.ts @@ -46,7 +46,7 @@ Bleno.on('stateChange', (state: string) => { }); const characteristic = new EchoCharacteristic(); -Bleno.on('advertisingStart', (error: string) => { +Bleno.on('advertisingStart', (error?: Error | null) => { if (!error) { Bleno.setServices( [new Bleno.PrimaryService({uuid: 'ec00', characteristics: [ characteristic ] })], @@ -54,3 +54,265 @@ Bleno.on('advertisingStart', (error: string) => { ); } }); + +const SERVICE_UUID = '87B1E448-1C07-4957-B7D3-017DF4EE3863'; +const CONTROL_CHAR_UUID = '87B1E448-1C07-4957-B7D3-017DF4EE3864'; +const STATUS_CHAR_UUID = '87B1E448-1C07-4957-B7D3-017DF4EE3866'; + +class StatusCharacteristic extends Bleno.Characteristic { + constructor() { + super({ + uuid: 'STATUS_CHAR_UUID', + properties: ['read'], + descriptors: [ + new Bleno.Descriptor({ + uuid: '2901', + value: Buffer.from('Status'), + }), + ], + }); + } + + onReadRequest( + offset: number, + callback: (result: number, data?: Buffer) => void + ) { + try { + const data = Buffer.from('status ok'); + callback(Bleno.Characteristic.RESULT_SUCCESS, data.slice(offset)); + } catch (error) { + callback(Bleno.Characteristic.RESULT_UNLIKELY_ERROR); + } + } +} + +class ControlCharacteristic extends Bleno.Characteristic { + private readonly callback: (data: Buffer) => void; + + constructor(onWriteRequestCb: (data: Buffer) => void) { + super({ + uuid: CONTROL_CHAR_UUID, + properties: ['write'], + descriptors: [ + new Bleno.Descriptor({ + uuid: '2901', + value: Buffer.from('test characteristic'), + }), + ], + }); + this.callback = onWriteRequestCb; + } + + onWriteRequest( + data: Buffer, + offset: number, + withoutResponse: any, + callback: (result: number) => void + ): void { + if (offset > 0) { + this.callback(data.slice(offset)); + } else { + this.callback(data); + } + callback(this.RESULT_SUCCESS); + } +} + +export class BluetoothController { + private isAdvertising: boolean; + + constructor() { + this.isAdvertising = false; + this.setup(); + } + + toString(): string { + return ''; + } + + dispose(callback: () => void) { + if (this.isAdvertising) { + Bleno.stopAdvertising(callback); + } else { + callback(); + } + } + + private setup() { + Bleno.on('stateChange', (state: string) => { + console.log('bluetooth', `stateChange: ${state}, address = ${Bleno.address}`); + + if (state === 'poweredOn') { + Bleno.startAdvertising('device', [SERVICE_UUID]); + } else { + Bleno.stopAdvertising(); + } + }); + + Bleno.on('accept', (clientAddress: string) => { + console.log('bluetooth', `accept, client: ${clientAddress}`); + Bleno.updateRssi(); + }); + + Bleno.on('disconnect', (clientAddress: string) => { + console.log('bluetooth', `disconnect, client: ${clientAddress}`); + }); + + Bleno.on('rssiUpdate', (rssi: number) => { + console.log('bluetooth', `rssiUpdate: ${rssi}`); + }); + + Bleno.on('mtuChange', (mtu: number) => { + console.log('bluetooth', `mtuChange: ${mtu}`); + }); + + Bleno.on('advertisingStart', (error?: Error | null) => { + console.log('bluetooth', `advertisingStart: ${error ? error : 'success'}`); + if (!error) { + this.isAdvertising = true; + Bleno.setServices([ + new Bleno.PrimaryService({ + uuid: SERVICE_UUID, + characteristics: [ + new ControlCharacteristic((data) => { + this.onWriteRequest(data); + }), + new StatusCharacteristic(), + ], + }), + ]); + } + }); + + Bleno.on('advertisingStop', () => { + this.isAdvertising = false; + console.log('bluetooth', 'advertisingStop'); + }); + + Bleno.on('servicesSet', (error?: Error | null) => { + console.log('bluetooth', `servicesSet: ${error ? error : 'success'}`); + }); + } + + private onWriteRequest(data: Buffer) { + console.log(data.toString('hex')); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// code from bleno's README +// + +const bleno = Bleno; + +function test1() { + const name = 'name'; + const serviceUuids = ['fffffffffffffffffffffffffffffff0']; + + bleno.startAdvertising(name); + bleno.startAdvertising(name, serviceUuids); + bleno.startAdvertising(name, serviceUuids, (error) => {}); +} + +function test2() { + const uuid = 'e2c56db5dffb48d2b060d0f5a71096e0'; + const major = 0; // 0x0000 - 0xffff + const minor = 0; // 0x0000 - 0xffff + const measuredPower = -59; // -128 - 127 + + bleno.startAdvertisingIBeacon(uuid, major, minor, measuredPower); + bleno.startAdvertisingIBeacon(uuid, major, minor, measuredPower, (error) => {}); +} + +function test3() { + const scanData = new Buffer(''); // maximum 31 bytes + const advertisementData = new Buffer(''); // maximum 31 bytes + + bleno.startAdvertisingWithEIRData(advertisementData); + bleno.startAdvertisingWithEIRData(advertisementData, (error) => {}); + bleno.startAdvertisingWithEIRData(advertisementData, scanData, (error) => {}); +} + +function test4() { + bleno.stopAdvertising(); + bleno.stopAdvertising(() => {}); +} + +function test5() { + const service = new bleno.PrimaryService({uuid: '0000'}); + const services = [ + service + ]; + + bleno.setServices(services); + bleno.setServices(services, (error) => {}); +} + +function test6() { + bleno.disconnect(); // Linux only +} + +function test7() { + bleno.updateRssi(); // not available in OS X 10.9 + bleno.updateRssi((error, rssi) => {}); // not available in OS X 10.9 +} + +function test8() { + const PrimaryService = bleno.PrimaryService; + + const primaryService = new PrimaryService({ + uuid: 'fffffffffffffffffffffffffffffff0', // or 'fff0' for 16-bit + characteristics: [ + // see Characteristic for data type + ] + }); +} + +function test9() { + const Characteristic = bleno.Characteristic; + + const characteristic = new Characteristic({ + uuid: 'fffffffffffffffffffffffffffffff1', // or 'fff1' for 16-bit + properties: ['read'], // can be a combination of 'read', 'write', 'writeWithoutResponse', 'notify', 'indicate' + secure: ['notify'], // enable security for properties, can be a combination of 'read', 'write', 'writeWithoutResponse', 'notify', 'indicate' + value: null, // optional static value, must be of type Buffer - for read only characteristics + descriptors: [ + // see Descriptor for data type + new bleno.Descriptor({uuid: '0000'}) + ], + onReadRequest: null, // optional read request handler, function(offset, callback) { ... } + onWriteRequest: null, // optional write request handler, function(data, offset, withoutResponse, callback) { ...} + onSubscribe: null, // optional notify/indicate subscribe handler, function(maxValueSize, updateValueCallback) { ...} + onUnsubscribe: null, // optional notify/indicate unsubscribe handler, function() { ...} + onNotify: null, // optional notify sent handler, function() { ...} + onIndicate: null // optional indicate confirmation received handler, function() { ...} + }); +} + +function test10() { + bleno.Characteristic.RESULT_SUCCESS; + bleno.Characteristic.RESULT_INVALID_OFFSET; + bleno.Characteristic.RESULT_INVALID_ATTRIBUTE_LENGTH; + bleno.Characteristic.RESULT_UNLIKELY_ERROR; +} + +function test11() { + const Descriptor = bleno.Descriptor; + + const descriptor = new Descriptor({ + uuid: '2901', + value: 'value' // static value, must be of type Buffer or string if set + }); +} + +function test12() { + bleno.on('stateChange', (state: string) => {}); + bleno.on('advertisingStart', (error?: Error | null) => {}); + bleno.on('advertisingStartError', (error: Error) => {}); + bleno.on('advertisingStop', () => {}); + bleno.on('servicesSet', (error?: Error | null) => {}); + bleno.on('servicesSetError', (error: Error) => {}); + bleno.on('accept', (clientAddress) => {}); // not available on OS X 10.9 + bleno.on('disconnect', (clientAddress) => {}); // Linux only + bleno.on('rssiUpdate', (rssi) => {}); // not available on OS X 10.9 +} diff --git a/types/bleno/index.d.ts b/types/bleno/index.d.ts index a59e394a84..0dee37c9ed 100644 --- a/types/bleno/index.d.ts +++ b/types/bleno/index.d.ts @@ -3,126 +3,147 @@ // Definitions by: Manuel Francisco Naranjo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export class Characteristic { - uuid: any; - properties: any; - secure: any; - value: any; - descriptors: any; +/// - constructor(options: any); +type State = 'poweredOn' | 'poweredOff' | 'unauthorized' | 'unsupported' | 'unknown' | 'resetting'; + +type Property = 'read' | 'write' | 'indicate' | 'notify' | 'writeWithoutResponse'; + +interface CharacteristicOptions { + uuid: string; + properties?: ReadonlyArray | null; + secure?: ReadonlyArray | null; + value?: Buffer | null; + descriptors?: ReadonlyArray | null; + onIndicate?: (() => void) | null; + onNotify?: (() => void) | null; + onReadRequest?: (( + offset: number, + callback: (result: number, data?: Buffer) => void + ) => void) | null; + onSubscribe?: ((maxValueSize: number, updateValueCallback: any) => void) | null; + onUnsubscribe?: (() => void) | null; + onWriteRequest?: (( + data: Buffer, + offset: number, + withoutResponse: boolean, + callback: (result: number) => void + ) => void) | null; +} + +declare class Characteristic { + uuid: string; + properties: ReadonlyArray; + secure: ReadonlyArray; + value: Buffer | null; + descriptors: ReadonlyArray; + + constructor(options: CharacteristicOptions); onIndicate(): void; onNotify(): void; - onReadRequest(offset: any, callback: any): void; + onReadRequest(offset: number, callback: (result: number, data?: Buffer) => void): void; - onSubscribe(maxValueSize: any, updateValueCallback: any): void; + onSubscribe(maxValueSize: number, updateValueCallback: any): void; onUnsubscribe(): void; - onWriteRequest(data: any, offset: any, withoutResponse: any, callback: any): void; + onWriteRequest(data: Buffer, offset: number, withoutResponse: boolean, callback: (result: number) => void): void; - toString(): any; + toString(): string; - static RESULT_ATTR_NOT_LONG: number; + readonly RESULT_ATTR_NOT_LONG: number; - static RESULT_INVALID_ATTRIBUTE_LENGTH: number; + readonly RESULT_INVALID_ATTRIBUTE_LENGTH: number; - static RESULT_INVALID_OFFSET: number; + readonly RESULT_INVALID_OFFSET: number; - static RESULT_SUCCESS: number; + readonly RESULT_SUCCESS: number; - static RESULT_UNLIKELY_ERROR: number; + readonly RESULT_UNLIKELY_ERROR: number; + + static readonly RESULT_ATTR_NOT_LONG: number; + + static readonly RESULT_INVALID_ATTRIBUTE_LENGTH: number; + + static readonly RESULT_INVALID_OFFSET: number; + + static readonly RESULT_SUCCESS: number; + + static readonly RESULT_UNLIKELY_ERROR: number; } -export class Descriptor { - uuid: any; - value: any; - - constructor(options: any); - - toString(): any; +interface DescriptorOptions { + uuid: string; + value?: Buffer | string | null; } -export class PrimaryService { - uuid: any; - characteristics: any; +declare class Descriptor { + uuid: string; + value: Buffer; - constructor(options: any); + constructor(options: DescriptorOptions); - toString(): any; + toString(): string; } -export const address: string; +interface PrimaryServiceOptions { + uuid: string; + characteristics?: ReadonlyArray | null; +} -export const domain: any; +declare class PrimaryService { + uuid: string; + characteristics: ReadonlyArray; -export const mtu: number; + constructor(options: PrimaryServiceOptions); -export const platform: string; + toString(): string; +} -export const rssi: number; +interface Bleno extends NodeJS.EventEmitter { + readonly Characteristic: typeof Characteristic; + readonly Descriptor: typeof Descriptor; + readonly PrimaryService: typeof PrimaryService; -export const state: string; + readonly address: string; -export function addListener(type: any, listener: any): any; + readonly mtu: number; -export function disconnect(): void; + readonly platform: string; -export function emit(type: any, ...args: any[]): any; + readonly rssi: number; -export function eventNames(): any; + readonly state: State; -export function getMaxListeners(): any; + disconnect(): void; -export function listenerCount(type: any): any; + setServices(services: ReadonlyArray, callback?: (arg: Error | undefined | null) => void): void; -export function listeners(type: any): any; + startAdvertising(name: string, serviceUuids?: ReadonlyArray, callback?: (arg: Error | undefined | null) => void): void; -export function on(type: any, listener: any): any; + startAdvertisingIBeacon(uuid: string, major: number, minor: number, measuredPower: number, callback?: (arg: Error | undefined | null) => void): void; -export function onAccept(clientAddress: any): void; + startAdvertisingWithEIRData(advertisementData: Buffer, callback?: (arg: Error | undefined | null) => void): void; + startAdvertisingWithEIRData(advertisementData: Buffer, scanData: Buffer, callback?: (arg: Error | undefined | null) => void): void; -export function onAddressChange(address: any): void; + stopAdvertising(callback?: () => void): void; -export function onAdvertisingStart(error: any): void; + updateRssi(callback?: (err: null, rssi: number) => void): void; -export function onAdvertisingStop(): void; + on(event: 'stateChange', cb: (state: State) => void): this; + on(event: 'accept', cb: (address: string) => void): this; + on(event: 'mtuChange', cb: (mtu: number) => void): this; + on(event: 'disconnect', cb: (clientAddress: string) => void): this; + on(event: 'advertisingStart', cb: (err?: Error | null) => void): this; + on(event: 'advertisingStartError', cb: (err: Error) => void): this; + on(event: 'advertisingStop', cb: () => void): this; + on(event: 'servicesSet', cb: (err?: Error | null) => void): this; + on(event: 'servicesSetError', cb: (err: Error) => void): this; + on(event: 'rssiUpdate', cb: (rssi: number) => void): this; +} -export function onDisconnect(clientAddress: any): void; - -export function onMtuChange(mtu: any): void; - -export function onPlatform(platform: any): void; - -export function onRssiUpdate(rssi: any): void; - -export function onServicesSet(error: any): void; - -export function onStateChange(state: any): void; - -export function once(type: any, listener: any): any; - -export function prependListener(type: any, listener: any): any; - -export function prependOnceListener(type: any, listener: any): any; - -export function removeAllListeners(type: any, ...args: any[]): any; - -export function removeListener(type: any, listener: any): any; - -export function setMaxListeners(n: any): any; - -export function setServices(services: any, callback: any): void; - -export function startAdvertising(name: any, serviceUuids: any, callback: any): void; - -export function startAdvertisingIBeacon(uuid: any, major: any, minor: any, measuredPower: any, callback: any): void; - -export function startAdvertisingWithEIRData(advertisementData: any, scanData: any, callback: any): void; - -export function stopAdvertising(callback: any): void; - -export function updateRssi(callback: any): void; +declare const bleno: Bleno; +export = bleno; diff --git a/types/bleno/tslint.json b/types/bleno/tslint.json index 26bcea6634..0f5eeaf557 100644 --- a/types/bleno/tslint.json +++ b/types/bleno/tslint.json @@ -1,6 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "dt-header": false + "dt-header": false, + "unified-signatures": false } } diff --git a/types/blocked/blocked-tests.ts b/types/blocked/blocked-tests.ts new file mode 100644 index 0000000000..f43eb82cba --- /dev/null +++ b/types/blocked/blocked-tests.ts @@ -0,0 +1,7 @@ +import * as blocked from 'blocked'; + +blocked((ms: number) => { + // todo: show warning +}, { + threshold: 10 +}); diff --git a/types/blocked/index.d.ts b/types/blocked/index.d.ts new file mode 100644 index 0000000000..5292011f23 --- /dev/null +++ b/types/blocked/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for blocked 1.2 +// Project: https://github.com/visionmedia/node-blocked#readme +// Definitions by: Jonas Lochmann +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +/*~ Note that ES6 modules cannot directly export callable functions. + *~ This file should be imported using the CommonJS-style: + *~ import x = require('someLibrary'); + *~ + *~ Refer to the documentation to understand common + *~ workarounds for this limitation of ES6 modules. + */ + +export = Blocked; + +declare function Blocked(callback: (ms: number) => void, options?: Blocked.Options): NodeJS.Timer; + +declare namespace Blocked { + interface Options { + threshold: number; // in milliseconds + } +} diff --git a/types/blocked/tsconfig.json b/types/blocked/tsconfig.json new file mode 100644 index 0000000000..3b110548b0 --- /dev/null +++ b/types/blocked/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", + "blocked-tests.ts" + ] +} diff --git a/types/blocked/tslint.json b/types/blocked/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/blocked/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/blockies/blockies-tests.ts b/types/blockies/blockies-tests.ts new file mode 100644 index 0000000000..31b9dcad48 --- /dev/null +++ b/types/blockies/blockies-tests.ts @@ -0,0 +1,4 @@ +import blockies = require('blockies'); + +const seed = 'seed'; +blockies({ seed }); diff --git a/types/blockies/index.d.ts b/types/blockies/index.d.ts new file mode 100644 index 0000000000..f2de8b2c53 --- /dev/null +++ b/types/blockies/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for blockies 0.0 +// Project: https://github.com/goldylucks/blockies-npm +// Definitions by: Leonid Logvinov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface BlockiesIcon { + toDataURL(): string; +} +interface BlockiesConfig { + seed: string; +} +declare function blockies(config: BlockiesConfig): BlockiesIcon; + +export = blockies; diff --git a/types/blockies/tsconfig.json b/types/blockies/tsconfig.json new file mode 100644 index 0000000000..f190f0b0c9 --- /dev/null +++ b/types/blockies/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "blockies-tests.ts"] +} diff --git a/types/blockies/tslint.json b/types/blockies/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/blockies/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/bn.js/bn.js-tests.ts b/types/bn.js/bn.js-tests.ts new file mode 100644 index 0000000000..670234ecfe --- /dev/null +++ b/types/bn.js/bn.js-tests.ts @@ -0,0 +1,6 @@ +import BN = require('bn.js'); + +let bn = new BN(42); +bn = bn.add(bn); +bn.isZero(); +bn.byteLength; diff --git a/types/bn.js/index.d.ts b/types/bn.js/index.d.ts new file mode 100644 index 0000000000..1a3d4f9b70 --- /dev/null +++ b/types/bn.js/index.d.ts @@ -0,0 +1,60 @@ +// Type definitions for bn.js 4.11 +// Project: https://github.com/indutny/bn.js +// Definitions by: Leonid Logvinov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +type Endianness = 'le' | 'be'; + +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; + + neg(): BN; + abs(): BN; + add(b: BN): BN; + sub(b: BN): BN; + mul(b: BN): BN; + sqr(): BN; + pow(b: BN): BN; + div(b: BN): BN; + mod(b: BN): BN; + divRound(b: BN): BN; + + or(b: BN): BN; + and(b: BN): BN; + xor(b: BN): BN; + setn(b: number): BN; + shln(b: number): BN; + shrn(b: number): BN; + testn(b: number): boolean; + maskn(b: number): BN; + bincn(b: number): BN; + notn(w: number): BN; + + gcd(b: BN): BN; + egcd(b: BN): { a: BN; b: BN; gcd: BN }; + invm(b: BN): BN; +} + +export = BN; diff --git a/types/bn.js/tsconfig.json b/types/bn.js/tsconfig.json new file mode 100644 index 0000000000..932e246886 --- /dev/null +++ b/types/bn.js/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "bn.js-tests.ts"] +} diff --git a/types/bn.js/tslint.json b/types/bn.js/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/bn.js/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/btoa/btoa-tests.ts b/types/btoa/btoa-tests.ts new file mode 100644 index 0000000000..d09cdad23a --- /dev/null +++ b/types/btoa/btoa-tests.ts @@ -0,0 +1,3 @@ +import btoa from 'btoa'; + +btoa('foo'); diff --git a/types/btoa/index.d.ts b/types/btoa/index.d.ts new file mode 100644 index 0000000000..cc311ed836 --- /dev/null +++ b/types/btoa/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for btoa 1.2 +// Project: https://git.coolaj86.com/coolaj86/btoa.js +// Definitions by: John Wright +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +export default function(str: string): string; diff --git a/types/btoa/tsconfig.json b/types/btoa/tsconfig.json new file mode 100644 index 0000000000..da4e373e68 --- /dev/null +++ b/types/btoa/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "lib": ["es6"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "btoa-tests.ts" + ] +} diff --git a/types/btoa/tslint.json b/types/btoa/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/btoa/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/bull/bull-tests.tsx b/types/bull/bull-tests.tsx index 765be54733..c2e0d3161f 100644 --- a/types/bull/bull-tests.tsx +++ b/types/bull/bull-tests.tsx @@ -7,7 +7,7 @@ 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 imageQueue = new Queue('image transcoding'); +const imageQueue: Queue.Queue<{ image: string }> = new Queue('image transcoding'); videoQueue.process((job, done) => { // job.data contains the custom data passed when the job was created diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index 15de8adfde..cdef279acb 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -6,6 +6,7 @@ // Weeco // Gabriel Terwesten // Oleg Repin +// David Koblas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -87,13 +88,18 @@ declare namespace Bull { type JobId = number | string; - interface Job { + interface Job { id: JobId; /** * The custom data passed when the job was created */ - data: any; + data: T; + + /** + * How many attempts where made to run this job + */ + attemptsMade: number; /** * Report progress on a job @@ -253,7 +259,7 @@ declare namespace Bull { next: number; } - interface Queue { + interface Queue { /** * Returns a promise that resolves when Redis is connected and the queue is ready to accept jobs. * This replaces the `ready` event emitted on Queue in previous verisons. @@ -271,7 +277,7 @@ declare namespace Bull { * Errors will be passed as a second argument to the "failed" event; * results, as a second argument to the "completed" event. */ - process(callback: (job: Job, done: DoneCallback) => void): void; + process(callback: (job: Job, done: DoneCallback) => void): void; /** * Defines a processing function for the jobs placed into a given Queue. @@ -289,7 +295,7 @@ declare namespace Bull { * If the promise is rejected, the error will be passed as a second argument to the "failed" event. * If it is resolved, its value will be the "completed" event's second argument. */ - process(callback: ((job: Job) => void) | string): Promise; + process(callback: ((job: Job) => void) | string): Promise; /** * Defines a processing function for the jobs placed into a given Queue. @@ -309,7 +315,7 @@ declare namespace Bull { * * @param concurrency Bull will then call you handler in parallel respecting this max number. */ - process(concurrency: number, callback: ((job: Job) => void) | string): Promise; + process(concurrency: number, callback: ((job: Job) => void) | string): Promise; /** * Defines a processing function for the jobs placed into a given Queue. @@ -324,7 +330,7 @@ declare namespace Bull { * * @param concurrency Bull will then call you handler in parallel respecting this max number. */ - process(concurrency: number, callback: (job: Job, done: DoneCallback) => void): void; + process(concurrency: number, callback: (job: Job, done: DoneCallback) => void): void; /** * Defines a named processing function for the jobs placed into a given Queue. @@ -345,7 +351,7 @@ declare namespace Bull { * @param name Bull will only call the handler if the job name matches */ // tslint:disable-next-line:unified-signatures - process(name: string, callback: ((job: Job) => void) | string): Promise; + process(name: string, callback: ((job: Job) => void) | string): Promise; /** * Defines a processing function for the jobs placed into a given Queue. @@ -361,7 +367,7 @@ declare namespace Bull { * @param name Bull will only call the handler if the job name matches */ // tslint:disable-next-line:unified-signatures - process(name: string, callback: (job: Job, done: DoneCallback) => void): void; + process(name: string, callback: (job: Job, done: DoneCallback) => void): void; /** * Defines a named processing function for the jobs placed into a given Queue. @@ -382,7 +388,7 @@ declare namespace Bull { * @param name Bull will only call the handler if the job name matches * @param concurrency Bull will then call you handler in parallel respecting this max number. */ - process(name: string, concurrency: number, callback: ((job: Job) => void) | string): Promise; + process(name: string, concurrency: number, callback: ((job: Job) => void) | string): Promise; /** * Defines a processing function for the jobs placed into a given Queue. @@ -398,21 +404,21 @@ declare namespace Bull { * @param name Bull will only call the handler if the job name matches * @param concurrency Bull will then call you handler in parallel respecting this max number. */ - process(name: string, concurrency: number, callback: (job: Job, done: DoneCallback) => void): void; + process(name: string, concurrency: number, callback: (job: Job, done: DoneCallback) => void): void; /** * Creates a new job and adds it to the queue. * If the queue is empty the job will be executed directly, * otherwise it will be placed in the queue and executed as soon as possible. */ - add(data: any, opts?: JobOptions): Promise; + add(data: T, opts?: JobOptions): Promise>; /** * Creates a new named job and adds it to the queue. * If the queue is empty the job will be executed directly, * otherwise it will be placed in the queue and executed as soon as possible. */ - add(name: string, data: any, opts?: JobOptions): Promise; + add(name: string, data: T, opts?: JobOptions): Promise>; /** * Returns a promise that resolves when the queue is paused. @@ -461,32 +467,32 @@ 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>; /** * Returns a promise that will return an array with the waiting jobs between start and end. */ - getWaiting(start?: number, end?: number): Promise; + getWaiting(start?: number, end?: number): Promise>>; /** * Returns a promise that will return an array with the active jobs between start and end. */ - getActive(start?: number, end?: number): Promise; + getActive(start?: number, end?: number): Promise>>; /** * Returns a promise that will return an array with the delayed jobs between start and end. */ - getDelayed(start?: number, end?: number): Promise; + getDelayed(start?: number, end?: number): Promise>>; /** * Returns a promise that will return an array with the completed jobs between start and end. */ - getCompleted(start?: number, end?: number): Promise; + getCompleted(start?: number, end?: number): Promise>>; /** * Returns a promise that will return an array with the failed jobs between start and end. */ - getFailed(start?: number, end?: number): Promise; + getFailed(start?: number, end?: number): Promise>>; /** * Returns JobInformation of repeatable jobs (ordered descending). Provide a start and/or an end @@ -497,7 +503,7 @@ declare namespace Bull { /** * ??? */ - nextRepeatableJob(name: string, data: any, opts: JobOptions): Promise; + nextRepeatableJob(name: string, data: any, opts: JobOptions): Promise>; /** * Removes a given repeatable job. The RepeatOptions and JobId needs to be the same as the ones @@ -560,7 +566,7 @@ declare namespace Bull { * @param status Status of the job to clean. Values are completed, wait, active, delayed, and failed. Defaults to completed. * @param limit Maximum amount of jobs to clean per call. If not provided will clean all matching jobs. */ - clean(grace: number, status?: JobStatus, limit?: number): Promise; + clean(grace: number, status?: JobStatus, limit?: number): Promise>>; /** * Listens to queue events @@ -575,28 +581,28 @@ declare namespace Bull { /** * A job has started. You can use `jobPromise.cancel()` to abort it */ - on(event: 'active', callback: ActiveEventCallback): this; + on(event: 'active', callback: ActiveEventCallback): this; /** * A job has been marked as stalled. * This is useful for debugging job workers that crash or pause the event loop. */ - on(event: 'stalled', callback: StalledEventCallback): this; + on(event: 'stalled', callback: StalledEventCallback): this; /** * A job's progress was updated */ - on(event: 'progress', callback: ProgressEventCallback): this; + on(event: 'progress', callback: ProgressEventCallback): this; /** * A job successfully completed with a `result` */ - on(event: 'completed', callback: CompletedEventCallback): this; + on(event: 'completed', callback: CompletedEventCallback): this; /** * A job failed with `err` as the reason */ - on(event: 'failed', callback: FailedEventCallback): this; + on(event: 'failed', callback: FailedEventCallback): this; /** * The queue has been paused @@ -614,7 +620,7 @@ declare namespace Bull { * * @see Queue#clean() for details */ - on(event: 'cleaned', callback: CleanedEventCallback): this; + on(event: 'cleaned', callback: CleanedEventCallback): this; } type EventCallback = () => void; @@ -628,17 +634,17 @@ declare namespace Bull { cancel(): void; } - type ActiveEventCallback = (job: Job, jobPromise?: JobPromise) => void; + type ActiveEventCallback = (job: Job, jobPromise?: JobPromise) => void; - type StalledEventCallback = (job: Job) => void; + type StalledEventCallback = (job: Job) => void; - type ProgressEventCallback = (job: Job, progress: any) => void; + type ProgressEventCallback = (job: Job, progress: any) => void; - type CompletedEventCallback = (job: Job, result: any) => void; + type CompletedEventCallback = (job: Job, result: any) => void; - type FailedEventCallback = (job: Job, error: Error) => void; + type FailedEventCallback = (job: Job, error: Error) => void; - type CleanedEventCallback = (jobs: Job[], status: JobStatus) => void; + type CleanedEventCallback = (jobs: Array>, status: JobStatus) => void; } export = Bull; diff --git a/types/cesium/index.d.ts b/types/cesium/index.d.ts new file mode 100644 index 0000000000..21b80f7d05 --- /dev/null +++ b/types/cesium/index.d.ts @@ -0,0 +1,5118 @@ +// Type definitions for cesium 1.44 +// Project: http://cesiumjs.org +// Definitions by: Aigars Zeiza +// Harry Nicholls +// Jared Szechy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// tslint:disable-next-line:export-just-namespace +export = Cesium; +export as namespace Cesium; + +declare namespace Cesium { + type RenderState = any; + + interface Proxy { + getURL(resource: string): string; + } + + class ArcGisImageServerTerrainProvider extends TerrainProvider { + constructor(options: { url: string; token?: string; proxy?: any; tilingScheme?: TilingScheme; ellipsoid?: Ellipsoid; credit?: Credit | string }); + } + + class AssociativeArray { + length: number; + values: any[]; + contains(key: string | number): boolean; + set(key: string | number, value: any): void; + get(key: string | number): any; + remove(key: string | number): boolean; + removeAll(): void; + } + + class AxisAlignedBoundingBox { + minimum: Cartesian3; + maximum: Cartesian3; + center: Cartesian3; + constructor(minimum?: Cartesian3, maximum?: Cartesian3, center?: Cartesian3); + clone(result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox; + intersect(plane: Cartesian4): Intersect; + equals(right?: AxisAlignedBoundingBox): boolean; + static fromPoints(positions: Cartesian3[], result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox; + static clone(box: AxisAlignedBoundingBox, result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox; + static equals(left?: AxisAlignedBoundingBox, right?: AxisAlignedBoundingBox): boolean; + static intersect(box: AxisAlignedBoundingBox, plane: Cartesian4): Intersect; + } + + class BoundingRectangle { + x: number; + y: number; + width: number; + height: number; + constructor(x?: number, y?: number, width?: number, height?: number); + clone(result?: BoundingRectangle): BoundingRectangle; + intersect(right: BoundingRectangle): Intersect; + equals(right?: BoundingRectangle): boolean; + static fromPoints(positions: Cartesian2[], result?: BoundingRectangle): BoundingRectangle; + static fromRectangle(rectangle: Rectangle, projection?: any, result?: BoundingRectangle): BoundingRectangle; + static clone(rectangle: BoundingRectangle, result?: BoundingRectangle): BoundingRectangle; + static union(left: BoundingRectangle, right: BoundingRectangle, result?: BoundingRectangle): BoundingRectangle; + static expand(rectangle: BoundingRectangle, point: Cartesian2, result?: BoundingRectangle): BoundingRectangle; + static intersect(left: BoundingRectangle, right: BoundingRectangle): Intersect; + static equals(left?: BoundingRectangle, right?: BoundingRectangle): boolean; + } + + class BoundingSphere extends Packable { + center: Cartesian3; + radius: number; + constructor(center?: Cartesian3, radius?: number); + intersect(plane: Cartesian4): Intersect; + equals(right?: BoundingSphere): boolean; + clone(result?: BoundingSphere): BoundingSphere; + static fromPoints(positions: Cartesian3[], result?: BoundingSphere): BoundingSphere; + static fromRectangle2D(rectangle: Rectangle, projection?: any, result?: BoundingSphere): BoundingSphere; + static fromRectangleWithHeights2D(rectangle: Rectangle, projection?: any, minimumHeight?: number, maximumHeight?: number, result?: BoundingSphere): BoundingSphere; + static fromRectangle3D(rectangle: Rectangle, ellipsoid?: Ellipsoid, surfaceHeight?: number, result?: BoundingSphere): BoundingSphere; + static fromVertices(positions: Cartesian3[], center?: Cartesian3, stride?: number, result?: BoundingSphere): BoundingSphere; + static fromCornerPoints(corner?: number, oppositeCorner?: number, result?: BoundingSphere): BoundingSphere; + static fromEllipsoid(ellipsoid: Ellipsoid, result?: BoundingSphere): BoundingSphere; + static fromBoundingSpheres(boundingSpheres: BoundingSphere[], result?: BoundingSphere): BoundingSphere; + static clone(sphere: BoundingSphere, result?: BoundingSphere): BoundingSphere; + static pack(value: BoundingSphere, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: BoundingSphere): BoundingSphere; + static union(left: BoundingSphere, right: BoundingSphere, result?: BoundingSphere): BoundingSphere; + static expand(sphere: BoundingSphere, point: Cartesian3, result?: BoundingSphere): BoundingSphere; + static intersect(sphere: BoundingSphere, plane: Cartesian4): Intersect; + static transform(sphere: BoundingSphere, transform: Matrix4, result?: BoundingSphere): BoundingSphere; + static distanceSquaredTo(sphere: BoundingSphere, cartesian: Cartesian3): number; + static transformWithoutScale(sphere: BoundingSphere, transform: Matrix4, result?: BoundingSphere): BoundingSphere; + static computePlaneDistances(sphere: BoundingSphere, position: Cartesian3, direction: Cartesian3, result?: Cartesian2): Interval; + static projectTo2D(sphere: BoundingSphere, projection?: any, result?: BoundingSphere): BoundingSphere; + static equals(left?: BoundingSphere, right?: BoundingSphere): boolean; + } + + class BoxGeometry extends Packable { + constructor(options: { minimumCorner: Cartesian3; maximumCorner: Cartesian3; vertexFormat?: VertexFormat }); + static fromDimensions(): void; + static unpack(array: number[], startingIndex?: number, result?: BoxGeometry): BoxGeometry; + static createGeometry(boxGeometry: BoxGeometry): Geometry; + } + + class BoxOutlineGeometry extends Packable { + constructor(); + static fromDimensions(): void; + static unpack(array: number[], startingIndex?: number, result?: BoxOutlineGeometry): BoxOutlineGeometry; + static createGeometry(boxGeometry: BoxOutlineGeometry): Geometry; + } + + class Cartesian2 extends Packable { + x: number; + y: number; + static ZERO: Cartesian2; + static UNIT_X: Cartesian2; + static UNIT_Y: Cartesian2; + constructor(x?: number, y?: number); + clone(result?: Cartesian2): Cartesian2; + equals(right?: Cartesian2): boolean; + equalsEpsilon(right: Cartesian2, relativeEpsilon: number, absoluteEpsilon?: number): boolean; + toString(): string; + static fromElements(x: number, y: number, result?: Cartesian2): Cartesian2; + static clone(cartesian: Cartesian2, result?: Cartesian2): Cartesian2; + static fromCartesian3(cartesian: Cartesian3, result?: Cartesian2): Cartesian2; + static fromCartesian4(cartesian: Cartesian4, result?: Cartesian2): Cartesian2; + static pack(value: Cartesian2, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: Cartesian2): Cartesian2; + static fromArray(array: number[], startingIndex?: number, result?: Cartesian2): Cartesian2; + static maximumComponent(cartesian: Cartesian2): number; + static minimumComponent(cartesian: Cartesian2): number; + static minimumByComponent(first: Cartesian2, second: Cartesian2, result: Cartesian2): Cartesian2; + static maximumByComponent(first: Cartesian2, second: Cartesian2, result: Cartesian2): Cartesian2; + static magnitudeSquared(cartesian: Cartesian2): number; + static magnitude(cartesian: Cartesian2): number; + static distance(left: Cartesian2, right: Cartesian2): number; + static distanceSquared(left: Cartesian2, right: Cartesian2): number; + static normalize(cartesian: Cartesian2, result: Cartesian2): Cartesian2; + static dot(left: Cartesian2, right: Cartesian2): number; + static multiplyComponents(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2; + static add(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2; + static subtract(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2; + static multiplyByScalar(cartesian: Cartesian2, scalar: number, result: Cartesian2): Cartesian2; + static divideByScalar(cartesian: Cartesian2, scalar: number, result: Cartesian2): Cartesian2; + static negate(cartesian: Cartesian2, result: Cartesian2): Cartesian2; + static abs(cartesian: Cartesian2, result: Cartesian2): Cartesian2; + static lerp(start: Cartesian2, end: Cartesian2, t: number, result: Cartesian2): Cartesian2; + static angleBetween(left: Cartesian2, right: Cartesian2): number; + static mostOrthogonalAxis(cartesian: Cartesian2, result: Cartesian2): Cartesian2; + static equals(left?: Cartesian2, right?: Cartesian2): boolean; + static equalsEpsilon(left: Cartesian2, right: Cartesian2, relativeEpsilon: number, absoluteEpsilon?: number): boolean; + } + + class Cartesian3 extends Packable implements PositionProperty { + x: number; + y: number; + z: number; + static ZERO: Cartesian3; + static UNIT_X: Cartesian3; + static UNIT_Y: Cartesian3; + static UNIT_Z: Cartesian3; + constructor(x?: number, y?: number, z?: number); + clone(result?: Cartesian3): Cartesian3; + equals(right?: Cartesian3): boolean; + equalsEpsilon(right: Cartesian3, relativeEpsilon: number, absoluteEpsilon?: number): boolean; + toString(): string; + static fromSpherical(spherical: Spherical, result?: Cartesian3): Cartesian3; + static fromElements(x: number, y: number, z: number, result?: Cartesian3): Cartesian3; + static clone(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + static fromCartesian4(cartesian: Cartesian4, result?: Cartesian3): Cartesian3; + static pack(value: Cartesian3, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: Cartesian3): Cartesian3; + static fromArray(array: number[], startingIndex?: number, result?: Cartesian3): Cartesian3; + static maximumComponent(cartesian: Cartesian3): number; + static minimumComponent(cartesian: Cartesian3): number; + static minimumByComponent(first: Cartesian3, second: Cartesian3, result: Cartesian3): Cartesian3; + static maximumByComponent(first: Cartesian3, second: Cartesian3, result: Cartesian3): Cartesian3; + static magnitudeSquared(cartesian: Cartesian3): number; + static magnitude(cartesian: Cartesian3): number; + static distance(left: Cartesian3, right: Cartesian3): number; + static distanceSquared(left: Cartesian3, right: Cartesian3): number; + static normalize(cartesian: Cartesian3, result: Cartesian3): Cartesian3; + static dot(left: Cartesian3, right: Cartesian3): number; + static multiplyComponents(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3; + static add(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3; + static subtract(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3; + static multiplyByScalar(cartesian: Cartesian3, scalar: number, result: Cartesian3): Cartesian3; + static divideByScalar(cartesian: Cartesian3, scalar: number, result: Cartesian3): Cartesian3; + static negate(cartesian: Cartesian3, result: Cartesian3): Cartesian3; + static abs(cartesian: Cartesian3, result: Cartesian3): Cartesian3; + static lerp(start: Cartesian3, end: Cartesian3, t: number, result: Cartesian3): Cartesian3; + static angleBetween(left: Cartesian3, right: Cartesian3): number; + static mostOrthogonalAxis(cartesian: Cartesian3, result: Cartesian3): Cartesian3; + static equals(left?: Cartesian3, right?: Cartesian3): boolean; + static equalsEpsilon(left: Cartesian3, right: Cartesian3, relativeEpsilon: number, absoluteEpsilon?: number): boolean; + static cross(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3; + static fromDegrees(longitude: number, latitude: number, height?: number, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3; + static fromRadians(longitude: number, latitude: number, height?: number, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3; + static fromDegreesArray(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[]; + static fromRadiansArray(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[]; + static fromDegreesArrayHeights(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[]; + static fromRadiansArrayHeights(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[]; + isConstant: boolean; + definitionChanged: Event; + referenceFrame: ReferenceFrame; + getValue(time: JulianDate, result?: Cartesian3): Cartesian3; + getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3; + } + + class Cartesian4 extends Packable { + x: number; + y: number; + z: number; + w: number; + static ZERO: Cartesian4; + static UNIT_X: Cartesian4; + static UNIT_Y: Cartesian4; + static UNIT_Z: Cartesian4; + static UNIT_W: Cartesian4; + constructor(x?: number, y?: number, z?: number, w?: number); + clone(result?: Cartesian4): Cartesian4; + equals(right?: Cartesian4): boolean; + equalsEpsilon(right: Cartesian4, relativeEpsilon: number, absoluteEpsilon?: number): boolean; + toString(): string; + static fromElements(x: number, y: number, z: number, w: number, result?: Cartesian4): Cartesian4; + static fromColor(color: Color, result?: Cartesian4): Cartesian4; + static clone(cartesian: Cartesian4, result?: Cartesian4): Cartesian4; + static pack(value: Cartesian4, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: Cartesian4): Cartesian4; + static fromArray(array: number[], startingIndex?: number, result?: Cartesian4): Cartesian4; + static maximumComponent(cartesian: Cartesian4): number; + static minimumComponent(cartesian: Cartesian4): number; + static minimumByComponent(first: Cartesian4, second: Cartesian4, result: Cartesian4): Cartesian4; + static maximumByComponent(first: Cartesian4, second: Cartesian4, result: Cartesian4): Cartesian4; + static magnitudeSquared(cartesian: Cartesian4): number; + static magnitude(cartesian: Cartesian4): number; + static distance(left: Cartesian4, right: Cartesian4): number; + static distanceSquared(left: Cartesian4, right: Cartesian4): number; + static normalize(cartesian: Cartesian4, result: Cartesian4): Cartesian4; + static dot(left: Cartesian4, right: Cartesian4): number; + static multiplyComponents(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4; + static add(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4; + static subtract(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4; + static multiplyByScalar(cartesian: Cartesian4, scalar: number, result: Cartesian4): Cartesian4; + static divideByScalar(cartesian: Cartesian4, scalar: number, result: Cartesian4): Cartesian4; + static negate(cartesian: Cartesian4, result: Cartesian4): Cartesian4; + static abs(cartesian: Cartesian4, result: Cartesian4): Cartesian4; + static lerp(start: Cartesian4, end: Cartesian4, t: number, result: Cartesian4): Cartesian4; + static mostOrthogonalAxis(cartesian: Cartesian4, result: Cartesian4): Cartesian4; + static equals(left?: Cartesian4, right?: Cartesian4): boolean; + static equalsEpsilon(left: Cartesian4, right: Cartesian4, relativeEpsilon: number, absoluteEpsilon?: number): boolean; + } + + class Cartographic { + longitude: number; + latitude: number; + height: number; + static ZERO: Cartographic; + constructor(longitude?: number, latitude?: number, height?: number); + clone(result?: Cartographic): Cartographic; + equals(right?: Cartographic): boolean; + equalsEpsilon(right: Cartographic, epsilon: number): boolean; + toString(): string; + static fromRadians(longitude: number, latitude: number, height?: number, result?: Cartographic): Cartographic; + static fromDegrees(longitude: number, latitude: number, height?: number, result?: Cartographic): Cartographic; + static clone(cartographic: Cartographic, result?: Cartographic): Cartographic; + static equals(left?: Cartographic, right?: Cartographic): boolean; + static equalsEpsilon(left: Cartographic, right: Cartographic, epsilon: number): boolean; + } + + class CatmullRomSpline { + times: number[]; + points: Cartesian3[]; + firstTangent: Cartesian3; + lastTangent: Cartesian3; + constructor(options: { times: number[]; points: Cartesian3[]; firstTangent?: Cartesian3; lastTangent?: Cartesian3 }); + findTimeInterval(time: number): number; + evaluate(time: number, result?: Cartesian3): Cartesian3; + } + + class CesiumTerrainProvider extends TerrainProvider { + requestVertexNormals: boolean; + requestWaterMask: boolean; + constructor(options: { url: string; proxy?: Proxy; requestVertexNormals?: boolean; requestWaterMask?: boolean; ellipsoid?: Ellipsoid; credit?: Credit | string }); + } + + class CircleGeometry extends Packable { + constructor(options: { + center: Cartesian3; + radius: number; + ellipsoid?: Ellipsoid; + height?: number; + granularity?: number; + vertexFormat?: VertexFormat; + extrudedHeight?: number; + stRotation?: number + }); + static unpack(array: number[], startingIndex?: number, result?: CircleGeometry): number[]; + static createGeometry(circleGeometry: CircleGeometry): Geometry; + } + + class CircleOutlineGeometry extends Packable { + constructor(options: { center: Cartesian3; radius: number; ellipsoid?: Ellipsoid; height?: number; granularity?: number; extrudedHeight?: number; numberOfVerticalLines?: number }); + static unpack(array: number[], startingIndex?: number, result?: CircleOutlineGeometry): number[]; + static createGeometry(circleGeometry: CircleOutlineGeometry): Geometry; + } + + class Clock { + startTime: JulianDate; + stopTime: JulianDate; + currentTime: JulianDate; + multiplier: number; + clockStep: ClockStep; + clockRange: ClockRange; + canAnimate: boolean; + shouldAnimate: boolean; + onTick: Event; + constructor(options: { + startTime?: JulianDate; + stopTime?: JulianDate; + currentTime?: JulianDate; + multiplier?: number; + clockStep?: ClockStep; + clockRange?: ClockRange; + canAnimate?: boolean; + shouldAnimate?: + boolean + }); + tick(): JulianDate; + } + + class Color extends Packable { + red: number; + green: number; + blue: number; + alpha: number; + static ALICEBLUE: Color; + static ANTIQUEWHITE: Color; + static AQUA: Color; + static AQUAMARINE: Color; + static AZURE: Color; + static BEIGE: Color; + static BISQUE: Color; + static BLACK: Color; + static BLANCHEDALMOND: Color; + static BLUE: Color; + static BLUEVIOLET: Color; + static BROWN: Color; + static BURLYWOOD: Color; + static CADETBLUE: Color; + static CHARTREUSE: Color; + static CHOCOLATE: Color; + static CORAL: Color; + static CORNFLOWERBLUE: Color; + static CORNSILK: Color; + static CRIMSON: Color; + static CYAN: Color; + static DARKBLUE: Color; + static DARKCYAN: Color; + static DARKGOLDENROD: Color; + static DARKGRAY: Color; + static DARKGREEN: Color; + static DARKGREY: Color; + static DARKKHAKI: Color; + static DARKMAGENTA: Color; + static DARKOLIVEGREEN: Color; + static DARKORANGE: Color; + static DARKORCHID: Color; + static DARKRED: Color; + static DARKSALMON: Color; + static DARKSEAGREEN: Color; + static DARKSLATEBLUE: Color; + static DARKSLATEGRAY: Color; + static DARKSLATEGREY: Color; + static DARKTURQUOISE: Color; + static DARKVIOLET: Color; + static DEEPPINK: Color; + static DEEPSKYBLUE: Color; + static DIMGRAY: Color; + static DIMGREY: Color; + static DODGERBLUE: Color; + static FIREBRICK: Color; + static FLORALWHITE: Color; + static FORESTGREEN: Color; + static FUSCHIA: Color; + static GAINSBORO: Color; + static GHOSTWHITE: Color; + static GOLD: Color; + static GOLDENROD: Color; + static GRAY: Color; + static GREEN: Color; + static GREENYELLOW: Color; + static GREY: Color; + static HONEYDEW: Color; + static HOTPINK: Color; + static INDIANRED: Color; + static INDIGO: Color; + static IVORY: Color; + static KHAKI: Color; + static LAVENDER: Color; + static LAVENDAR_BLUSH: Color; + static LAWNGREEN: Color; + static LEMONCHIFFON: Color; + static LIGHTBLUE: Color; + static LIGHTCORAL: Color; + static LIGHTCYAN: Color; + static LIGHTGOLDENRODYELLOW: Color; + static LIGHTGRAY: Color; + static LIGHTGREEN: Color; + static LIGHTGREY: Color; + static LIGHTPINK: Color; + static LIGHTSEAGREEN: Color; + static LIGHTSKYBLUE: Color; + static LIGHTSLATEGRAY: Color; + static LIGHTSLATEGREY: Color; + static LIGHTSTEELBLUE: Color; + static LIGHTYELLOW: Color; + static LIME: Color; + static LIMEGREEN: Color; + static LINEN: Color; + static MAGENTA: Color; + static MAROON: Color; + static MEDIUMAQUAMARINE: Color; + static MEDIUMBLUE: Color; + static MEDIUMORCHID: Color; + static MEDIUMPURPLE: Color; + static MEDIUMSEAGREEN: Color; + static MEDIUMSLATEBLUE: Color; + static MEDIUMSPRINGGREEN: Color; + static MEDIUMTURQUOISE: Color; + static MEDIUMVIOLETRED: Color; + static MIDNIGHTBLUE: Color; + static MINTCREAM: Color; + static MISTYROSE: Color; + static MOCCASIN: Color; + static NAVAJOWHITE: Color; + static NAVY: Color; + static OLDLACE: Color; + static OLIVE: Color; + static OLIVEDRAB: Color; + static ORANGE: Color; + static ORANGERED: Color; + static ORCHID: Color; + static PALEGOLDENROD: Color; + static PALEGREEN: Color; + static PALETURQUOISE: Color; + static PALEVIOLETRED: Color; + static PAPAYAWHIP: Color; + static PEACHPUFF: Color; + static PERU: Color; + static PINK: Color; + static PLUM: Color; + static POWDERBLUE: Color; + static PURPLE: Color; + static RED: Color; + static ROSYBROWN: Color; + static ROYALBLUE: Color; + static SADDLEBROWN: Color; + static SALMON: Color; + static SANDYBROWN: Color; + static SEAGREEN: Color; + static SEASHELL: Color; + static SIENNA: Color; + static SILVER: Color; + static SKYBLUE: Color; + static SLATEBLUE: Color; + static SLATEGRAY: Color; + static SLATEGREY: Color; + static SNOW: Color; + static SPRINGGREEN: Color; + static STEELBLUE: Color; + static TAN: Color; + static TEAL: Color; + static THISTLE: Color; + static TOMATO: Color; + static TURQUOISE: Color; + static VIOLET: Color; + static WHEAT: Color; + static WHITE: Color; + static WHITESMOKE: Color; + static YELLOW: Color; + static YELLOWGREEN: Color; + static TRANSPARENT: Color; + static add(left: Color, right: Color, result?: Color): Color; + static byteToFloat(number: number): number; + static clone(color: Color, result?: Color): Color; + static divide(left: Color, right: Color, result?: Color): Color; + static divideByScalar(color: Color, scalar: number, result?: Color): Color; + static equals(left: Color, right: Color): boolean; + static floatToByte(number: number): number; + static fromAlpha(color: Color, alpha: number, result?: Color): Color; + static fromBytes(red?: number, green?: number, blue?: number, alpha?: number, result?: Color): Color; + static fromCartesian4(cartesian: Cartesian4, result?: Color): Color; + static fromCssColorString(color: string): Color; + static fromHsl(hue?: number, saturation?: number, lightness?: number, alpha?: number): Color; + static fromRandom(options?: { + red?: number; + minimumRed?: number; + maximumRed?: number; + green?: number; + minimumGreen?: number; + maximumGreen?: number; + blue?: number; + minimumBlue?: number; + maximumBlue?: number; + alpha?: number; + minimumAlpha?: number; + maximumAlpha?: number + }, result?: Color): Color; + static fromRgba(rgba: number): Color; + static mod(left: Color, right: Color, result?: Color): Color; + static multiply(left: Color, right: Color, result?: Color): Color; + static multiplyByScalar(color: Color, scalar: number, result?: Color): Color; + static pack(value: Color, array: number[], startingIndex?: number): number[]; + static subtract(left: Color, right: Color, result?: Color): Color; + static unpack(array: number[], startingIndex?: number, result?: Color): Color; + constructor(red?: number, green?: number, blue?: number, alpha?: number); + brighten(magnitude: number, result: Color): Color; + clone(result?: Color): Color; + darken(magnitude: number, result: Color): Color; + equals(other: Color): boolean; + equalsEpsilon(other: Color, epsilon?: number): boolean; + toBytes(result?: number[]): number[]; + toCssColorString(): string; + toRgba(): number; + toString(): string; + withAlpha(alpha: number, result?: Color): Color; + } + + class ColorGeometryInstanceAttribute { + value: Uint8Array; + componentDatatype: ComponentDatatype; + componentsPerAttribute: number; + normalize: boolean; + constructor(red?: number, green?: number, blue?: number, alpha?: number); + static fromColor(color: Color): ColorGeometryInstanceAttribute; + static toValue(color: Color, result?: Uint8Array): Uint8Array; + } + + class CorridorGeometry extends Packable { + constructor(options: { + positions: Cartesian3[]; + width: number; + ellipsoid?: Ellipsoid; + granularity?: number; + height?: number; + extrudedHeight?: number; + vertexFormat?: VertexFormat; + cornerType?: CornerType + }); + static unpack(array: number[], startingIndex?: number, result?: CorridorGeometry): CorridorGeometry; + static createGeometry(corridorGeometry: CorridorGeometry): Geometry; + } + + class CorridorOutlineGeometry extends Packable { + constructor(options: { + positions: Cartesian3[]; + width: number; + ellipsoid?: Ellipsoid; + granularity?: number; + height?: number; + extrudedHeight?: number; + cornerType?: CornerType + }); + static unpack(array: number[], startingIndex?: number, result?: CorridorOutlineGeometry): CorridorOutlineGeometry; + static createGeometry(corridorOutlineGeometry: CorridorOutlineGeometry): Geometry; + } + + class Credit { + readonly element: HTMLElement; + readonly html: string; + readonly imageUrl: string; + readonly link: string; + readonly showOnScreen: boolean; + readonly text: string; + constructor(html: string, showOnScreen?: boolean); + static equals(left: Credit, right: Credit): boolean; + equals(credits: Credit): boolean; + hasImage(): boolean; + hasLink(): boolean; + } + + class CylinderGeometry extends Packable { + constructor(options: { length: number; topRadius: number; bottomRadius: number; slices?: number; vertexFormat?: VertexFormat }); + static unpack(array: number[], startingIndex?: number, result?: CylinderGeometry): CylinderGeometry; + static createGeometry(cylinderGeometry: CylinderGeometry): Geometry; + } + + class CylinderOutlineGeometry extends Packable { + constructor(options: { length: number; topRadius: number; bottomRadius: number; slices?: number; numberOfVerticalLines?: number }); + static unpack(array: number[], startingIndex?: number, result?: CylinderOutlineGeometry): CylinderOutlineGeometry; + static createGeometry(cylinderGeometry: CylinderOutlineGeometry): Geometry; + } + + class DefaultProxy { + constructor(proxy: string); + getURL(resource: string): string; + } + + class DeveloperError { + name: string; + message: string; + stack: string; + constructor(message?: string); + } + + class EllipseGeometry extends Packable { + constructor(options: { + center: Cartesian3; + semiMajorAxis: number; + semiMinorAxis: number; + ellipsoid?: Ellipsoid; + height?: number; + extrudedHeight?: number; + rotation?: number; + stRotation?: number; + granularity?: number; + vertexFormat?: VertexFormat + }); + static unpack(array: number[], startingIndex?: number, result?: EllipseGeometry): EllipseGeometry; + static createGeometry(ellipseGeometry: EllipseGeometry): Geometry; + } + + class EllipseOutlineGeometry extends Packable { + constructor(options: { + center: Cartesian3; + semiMajorAxis: number; + semiMinorAxis: number; + ellipsoid?: Ellipsoid; + height?: number; + extrudedHeight?: number; + rotation?: number; + granularity?: number; + numberOfVerticalLines?: number + }); + static unpack(array: number[], startingIndex?: number, result?: EllipseOutlineGeometry): EllipseOutlineGeometry; + static createGeometry(ellipseGeometry: EllipseOutlineGeometry): Geometry; + } + + class Ellipsoid extends Packable { + radii: Cartesian3; + radiiSquared: Cartesian3; + radiiToTheFourth: Cartesian3; + oneOverRadii: Cartesian3; + oneOverRadiiSquared: Cartesian3; + minimumRadius: number; + maximumRadius: number; + static WGS84: Ellipsoid; + static UNIT_SPHERE: Ellipsoid; + static MOON: Ellipsoid; + constructor(x?: number, y?: number, z?: number); + clone(result?: Ellipsoid): Ellipsoid; + geocentricSurfaceNormal(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + geodeticSurfaceNormalCartographic(cartographic: Cartographic, result?: Cartesian3): Cartesian3; + geodeticSurfaceNormal(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + cartographicToCartesian(cartographic: Cartographic, result?: Cartesian3): Cartesian3; + cartographicArrayToCartesianArray(cartographics: Cartographic[], result?: Cartesian3[]): Cartesian3[]; + cartesianToCartographic(cartesian: Cartesian3, result?: Cartographic): Cartographic; + cartesianArrayToCartographicArray(cartesians: Cartesian3[], result?: Cartographic[]): Cartographic[]; + scaleToGeodeticSurface(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + scaleToGeocentricSurface(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + transformPositionToScaledSpace(position: Cartesian3, result?: Cartesian3): Cartesian3; + transformPositionFromScaledSpace(position: Cartesian3, result?: Cartesian3): Cartesian3; + equals(right?: Ellipsoid): boolean; + toString(): string; + static clone(ellipsoid: Ellipsoid, result?: Ellipsoid): Ellipsoid; + static fromCartesian3(radii?: Cartesian3): Ellipsoid; + static unpack(array: number[], startingIndex?: number, result?: Ellipsoid): Ellipsoid; + } + + class EllipsoidGeodesic { + surfaceDistance: number; + start: Cartographic; + end: Cartographic; + startHeading: number; + endHeading: number; + constructor(start?: Cartographic, end?: Cartographic, ellipsoid?: Ellipsoid); + setEndPoints(start: Cartographic, end: Cartographic): void; + interpolateUsingFraction(fraction: number): Cartographic; + interpolateUsingSurfaceDistance(distance: number): Cartographic; + } + + class EllipsoidGeometry extends Packable { + constructor(options?: { radii?: Cartesian3; stackPartitions?: number; slicePartitions?: number; vertexFormat?: VertexFormat }); + static unpack(array: number[], startingIndex?: number, result?: EllipsoidGeometry): EllipsoidGeometry; + static createGeometry(ellipsoidGeometry: EllipsoidGeometry): Geometry; + } + + class EllipsoidOutlineGeometry extends Packable { + constructor(options?: { radii?: Cartesian3; stackPartitions?: number; slicePartitions?: number; subdivisions?: number }); + static unpack(array: number[], startingIndex?: number, result?: EllipsoidOutlineGeometry): EllipsoidOutlineGeometry; + static createGeometry(ellipsoidGeometry: EllipsoidOutlineGeometry): Geometry; + } + + class EllipsoidTangentPlane { + ellipsoid: Ellipsoid; + origin: Cartesian3; + constructor(ellipsoid: Ellipsoid, origin: Cartesian3); + projectPointOntoPlane(cartesian: Cartesian3, result?: Cartesian2): Cartesian2; + projectPointsOntoPlane(cartesians: Cartesian3[], result?: Cartesian2[]): Cartesian2[]; + projectPointsOntoEllipsoid(cartesians: Cartesian2[], result?: Cartesian3[]): Cartesian3[]; + static fromPoints(ellipsoid: Ellipsoid, cartesians: Cartesian3): EllipsoidTangentPlane; + } + + class EllipsoidTerrainProvider extends TerrainProvider { + constructor(options?: { tilingScheme?: TilingScheme; ellipsoid?: Ellipsoid }); + } + + class Event { + numberOfListeners: number; + addEventListener(listener: () => void, scope?: any): Event.RemoveCallback; + removeEventListener(listener: () => void, scope?: any): boolean; + raiseEvent(...args: any[]): void; + } + + namespace Event { + type RemoveCallback = () => void; + } + + class EventHelper { + add(event: Event, listener: () => void, scope?: any): EventHelper.RemoveCallback; + removeAll(): void; + } + + namespace EventHelper { + type RemoveCallback = () => void; + } + + class GeographicProjection { + ellipsoid: Ellipsoid; + constructor(ellipsoid?: Ellipsoid); + project(cartographic: Cartographic, result?: Cartesian3): Cartesian3; + unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic; + } + + class GeographicTilingScheme { + ellipsoid: Ellipsoid; + rectangle: Rectangle; + projection: MapProjection; + constructor(options?: { ellipsoid?: Ellipsoid; rectangle?: Rectangle; numberOfLevelZeroTilesX?: number; numberOfLevelZeroTilesY?: number }); + getNumberOfXTilesAtLevel(level: number): number; + getNumberOfYTilesAtLevel(level: number): number; + rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle; + tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle; + tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle; + positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2; + } + + class Geometry { + attributes: GeometryAttributes; + indices: any[]; + primitiveType: PrimitiveType; + boundingSphere: BoundingSphere; + constructor(options: { attributes: GeometryAttributes; primitiveType?: PrimitiveType; indices?: Uint16Array | Uint32Array; boundingSphere?: BoundingSphere }); + static computeNumberOfVertices(geometry: Cartesian3): number; + } + + class GeometryAttribute { + componentDatatype: ComponentDatatype; + componentsPerAttribute: number; + normalize: boolean; + values: any[]; + constructor(options?: { componentDatatype?: ComponentDatatype; componentsPerAttribute?: number; normalize?: boolean; values?: number[] }); + } + + class GeometryAttributes { + position: GeometryAttribute; + normal: GeometryAttribute; + st: GeometryAttribute; + binormal: GeometryAttribute; + tangent: GeometryAttribute; + color: GeometryAttribute; + } + + class GeometryInstance { + geometry: Geometry; + modelMatrix: Matrix4; + id: any; + attributes: any; + constructor(options: { geometry: Geometry; modelMatrix?: Matrix4; id?: any; attributes?: any }); + } + + class GeometryInstanceAttribute { + componentDatatype: ComponentDatatype; + componentsPerAttribute: number; + normalize: boolean; + value: number[]; + constructor(options: { componentDatatype?: ComponentDatatype; componentsPerAttribute?: number; normalize?: boolean; value?: number[] }); + } + + class GregorianDate { + year: number; + month: number; + day: number; + hour: number; + minute: number; + second: number; + millisecond: number; + isLeapSecond: boolean; + } + + class HeightmapTerrainData { + waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement; + constructor(options: { + buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Float32Array | Float64Array; + width: number; + height: number; + childTileMask?: number; + structure?: any; + structureheightScale?: number; + structureheightOffset?: number; + structureelementsPerHeight?: number; + structurestride?: number; + structureelementMultiplier?: number; + structureisBigEndian?: boolean; + createdByUpsampling?: boolean + }); + createMesh(tilingScheme: TilingScheme, x: number, y: number, level: number): Promise; + interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number; + upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise; + isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean; + wasCreatedByUpsampling(): boolean; + } + + class HermiteSpline { + times: number[]; + points: Cartesian3[]; + inTangents: Cartesian3[]; + outTangents: Cartesian3[]; + constructor(options: { times: number[]; points: Cartesian3[]; inTangents: Cartesian3[]; outTangents: Cartesian3[] }); + findTimeInterval(time: number): number; + evaluate(time: number, result?: Cartesian3): Cartesian3; + static createC1(): HermiteSpline; + static createNaturalCubic(): HermiteSpline | LinearSpline; + static createClampedCubic(): HermiteSpline | LinearSpline; + } + + class IonImageryProvider extends ImageryProvider { + constructor(options: {assetId: number, accessToken?: string, server?: string}) + } + + class Interval { + start: number; + stop: number; + constructor(start?: number, stop?: number); + } + + class JulianDate { + dayNumber: number; + secondsOfDay: number; + static leapSeconds: LeapSecond[]; + constructor(julianDayNumber?: number, secondsOfDay?: number, timeStandard?: TimeStandard); + clone(result?: JulianDate): JulianDate; + equals(right?: JulianDate): boolean; + equalsEpsilon(right: JulianDate, epsilon: number): boolean; + toString(): string; + static fromDate(date: Date, result?: JulianDate): JulianDate; + static fromIso8601(iso8601String: string, result?: JulianDate): JulianDate; + static now(result?: JulianDate): JulianDate; + static toGregorianDate(julianDate: JulianDate, result?: GregorianDate): GregorianDate; + static toDate(julianDate: JulianDate): Date; + static toIso8601(julianDate: JulianDate, precision?: number): string; + static clone(julianDate: JulianDate, result?: JulianDate): JulianDate; + static compare(left: JulianDate, right: JulianDate): number; + static equals(left?: JulianDate, right?: JulianDate): boolean; + static equalsEpsilon(left: JulianDate, right: JulianDate, epsilon: number): boolean; + static totalDays(julianDate: JulianDate): number; + static secondsDifference(left: JulianDate, right: JulianDate): number; + static daysDifference(left: JulianDate, right: JulianDate): number; + static computeTaiMinusUtc(julianDate: JulianDate): number; + static addSeconds(julianDate: JulianDate, seconds: number, result: JulianDate): JulianDate; + static addMinutes(julianDate: JulianDate, minutes: number, result: JulianDate): JulianDate; + static addHours(julianDate: JulianDate, hours: number, result: JulianDate): JulianDate; + static addDays(julianDate: JulianDate, days: number, result: JulianDate): JulianDate; + static lessThan(left: JulianDate, right: JulianDate): boolean; + static lessThanOrEquals(left: JulianDate, right: JulianDate): boolean; + static greaterThan(left: JulianDate, right: JulianDate): boolean; + static greaterThanOrEquals(left: JulianDate, right: JulianDate): boolean; + } + + class LeapSecond { + julianDate: JulianDate; + offset: number; + constructor(date?: JulianDate, offset?: number); + } + + class LinearSpline { + times: number[]; + points: Cartesian3[]; + constructor(); + findTimeInterval(time: number): number; + evaluate(time: number, result?: Cartesian3): Cartesian3; + } + + class MapProjection { + ellipsoid: Ellipsoid; + project(cartographic: Cartographic, result?: Cartesian3): Cartesian3; + unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic; + } + + class Matrix2 extends Packable { + static IDENTITY: Matrix2; + static COLUMN0ROW0: number; + static COLUMN0ROW1: number; + static COLUMN1ROW0: number; + static COLUMN1ROW1: number; + constructor(column0Row0?: number, column1Row0?: number, column0Row1?: number, column1Row1?: number); + clone(result?: Matrix2): Matrix2; + equals(right?: Matrix2): boolean; + equalsEpsilon(right: Matrix2, epsilon: number): boolean; + toString(): string; + static pack(value: Matrix2, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: Matrix2): Matrix2; + static clone(matrix: Matrix2, result?: Matrix2): Matrix2; + static fromArray(array: number[], startingIndex?: number, result?: Matrix2): Matrix2; + static fromColumnMajorArray(values: number[], result?: Matrix2): Matrix2; + static fromRowMajorArray(values: number[], result?: Matrix2): Matrix2; + static fromScale(scale: Cartesian2, result?: Matrix2): Matrix2; + static fromUniformScale(scale: number, result?: Matrix2): Matrix2; + static fromRotation(angle: number, result?: Matrix2): Matrix2; + static toArray(matrix: Matrix2, result?: number[]): number[]; + static getElementIndex(row: number, column: number): number; + static getColumn(matrix: Matrix2, index: number, result: Cartesian2): Cartesian2; + static setColumn(matrix: Matrix2, index: number, cartesian: Cartesian2, result: Cartesian2): Matrix2; + static getRow(matrix: Matrix2, index: number, result: Cartesian2): Cartesian2; + static setRow(matrix: Matrix2, index: number, cartesian: Cartesian2, result: Matrix2): Matrix2; + static getScale(matrix: Matrix2, result: Cartesian2): Cartesian2; + static getMaximumScale(matrix: Matrix2): number; + static multiply(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2; + static add(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2; + static subtract(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2; + static multiplyByVector(matrix: Matrix2, cartesian: Cartesian2, result: Cartesian2): Cartesian2; + static multiplyByScalar(matrix: Matrix2, scalar: number, result: Matrix2): Matrix2; + static negate(matrix: Matrix2, result: Matrix2): Matrix2; + static transpose(matrix: Matrix2, result: Matrix2): Matrix2; + static abs(matrix: Matrix2, result: Matrix2): Matrix2; + static equals(left?: Matrix2, right?: Matrix2): boolean; + static equalsEpsilon(left: Matrix2, right: Matrix2, epsilon: number): boolean; + } + + class Matrix3 extends Packable { + static IDENTITY: Matrix3; + static COLUMN0ROW0: number; + static COLUMN0ROW1: number; + static COLUMN0ROW2: number; + static COLUMN1ROW0: number; + static COLUMN1ROW1: number; + static COLUMN1ROW2: number; + static COLUMN2ROW0: number; + static COLUMN2ROW1: number; + static COLUMN2ROW2: number; + constructor(column0Row0?: number, column1Row0?: number, column2Row0?: number, column0Row1?: number, column1Row1?: number, + column2Row1?: number, column0Row2?: number, column1Row2?: number, column2Row2?: number); + clone(result?: Matrix3): Matrix3; + equals(right?: Matrix3): boolean; + equalsEpsilon(right: Matrix3, epsilon: number): boolean; + toString(): string; + static pack(value: Matrix3, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: Matrix3): Matrix3; + static clone(matrix: Matrix3, result?: Matrix3): Matrix3; + static fromArray(array: number[], startingIndex?: number, result?: Matrix3): Matrix3; + static fromColumnMajorArray(values: number[], result?: Matrix3): Matrix3; + static fromRowMajorArray(values: number[], result?: Matrix3): Matrix3; + static fromQuaternion(quaternion: Quaternion): Matrix3; + static fromScale(scale: Cartesian3, result?: Matrix3): Matrix3; + static fromUniformScale(scale: number, result?: Matrix3): Matrix3; + static fromCrossProduct(the: Cartesian3, result?: Matrix3): Matrix3; + static fromRotationX(angle: number, result?: Matrix3): Matrix3; + static fromRotationY(angle: number, result?: Matrix3): Matrix3; + static fromRotationZ(angle: number, result?: Matrix3): Matrix3; + static toArray(matrix: Matrix3, result?: number[]): number[]; + static getElementIndex(row: number, column: number): number; + static getColumn(matrix: Matrix3, index: number, result: Cartesian3): Cartesian3; + static setColumn(matrix: Matrix3, index: number, cartesian: Cartesian3, result: Cartesian3): Matrix3; + static getRow(matrix: Matrix3, index: number, result: Cartesian3): Cartesian3; + static setRow(matrix: Matrix3, index: number, cartesian: Cartesian3, result: Cartesian3): Matrix3; + static getScale(matrix: Matrix3, result: Cartesian3): Cartesian3; + static getMaximumScale(matrix: Matrix3): number; + static multiply(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3; + static add(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3; + static subtract(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3; + static multiplyByVector(matrix: Matrix3, cartesian: Cartesian3, result: Cartesian3): Cartesian3; + static multiplyByScalar(matrix: Matrix3, scalar: number, result: Matrix3): Matrix3; + static negate(matrix: Matrix3, result: Matrix3): Matrix3; + static transpose(matrix: Matrix3, result: Matrix3): Matrix3; + static computeEigenDecomposition(matrix: Matrix3, result?: any): any; + static abs(matrix: Matrix3, result: Matrix3): Matrix3; + static determinant(matrix: Matrix3): number; + static inverse(matrix: Matrix3, result: Matrix3): Matrix3; + static equals(left?: Matrix3, right?: Matrix3): boolean; + static equalsEpsilon(left: Matrix3, right: Matrix3, epsilon: number): boolean; + } + + class Matrix4 extends Packable { + static IDENTITY: Matrix4; + static COLUMN0ROW0: number; + static COLUMN0ROW1: number; + static COLUMN0ROW2: number; + static COLUMN0ROW3: number; + static COLUMN1ROW0: number; + static COLUMN1ROW1: number; + static COLUMN1ROW2: number; + static COLUMN1ROW3: number; + static COLUMN2ROW0: number; + static COLUMN2ROW1: number; + static COLUMN2ROW2: number; + static COLUMN2ROW3: number; + static COLUMN3ROW0: number; + static COLUMN3ROW1: number; + static COLUMN3ROW2: number; + static COLUMN3ROW3: number; + constructor(column0Row0?: number, column1Row0?: number, column2Row0?: number, column3Row0?: number, column0Row1?: number, + column1Row1?: number, column2Row1?: number, column3Row1?: number, column0Row2?: number, column1Row2?: number, + column2Row2?: number, column3Row2?: number, column0Row3?: number, column1Row3?: number, column2Row3?: number, + column3Row3?: number); + clone(result?: Matrix4): Matrix4; + equals(right?: Matrix4): boolean; + equalsEpsilon(right: Matrix4, epsilon: number): boolean; + toString(): string; + static pack(value: Matrix4, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: Matrix4): Matrix4; + static clone(matrix: Matrix4, result?: Matrix4): Matrix4; + static fromArray(array: number[], startingIndex?: number, result?: Matrix4): Matrix4; + static fromColumnMajorArray(values: number[], result?: Matrix4): Matrix4; + static fromRowMajorArray(values: number[], result?: Matrix4): Matrix4; + static fromRotationTranslation(rotation: Matrix3, translation?: Cartesian3, result?: Matrix4): Matrix4; + static fromTranslationQuaternionRotationScale(translation: Cartesian3, rotation: Quaternion, scale: Cartesian3, result?: Matrix4): Matrix4; + static fromTranslation(translation: Cartesian3, result?: Matrix4): Matrix4; + static fromScale(scale: Cartesian3, result?: Matrix4): Matrix4; + static fromUniformScale(scale: number, result?: Matrix4): Matrix4; + static fromCamera(camera: Camera, result?: Matrix4): Matrix4; + static computePerspectiveFieldOfView(fovY: number, aspectRatio: number, near: number, far: number, result: Matrix4): Matrix4; + static computeOrthographicOffCenter(left: number, right: number, bottom: number, top: number, near: number, far: number, result: Matrix4): Matrix4; + static computePerspectiveOffCenter(left: number, right: number, bottom: number, top: number, near: number, far: number, result: Matrix4): Matrix4; + static computeInfinitePerspectiveOffCenter(left: number, right: number, bottom: number, top: number, near: number, far: number, result: Matrix4): Matrix4; + static computeViewportTransformation(viewport: any, nearDepthRange: number, farDepthRange: number, result: Matrix4): Matrix4; + static toArray(matrix: Matrix4, result?: number[]): number[]; + static getElementIndex(row: number, column: number): number; + static getColumn(matrix: Matrix4, index: number, result: Cartesian4): Cartesian4; + static setColumn(matrix: Matrix4, index: number, cartesian: Cartesian4, result: Cartesian4): Matrix4; + static getRow(matrix: Matrix4, index: number, result: Cartesian4): Cartesian4; + static setRow(matrix: Matrix4, index: number, cartesian: Cartesian4, result: Cartesian4): Matrix4; + static getScale(matrix: Matrix4, result: Cartesian3): Cartesian3; + static getMaximumScale(matrix: Matrix4): number; + static multiply(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4; + static add(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4; + static subtract(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4; + static multiplyTransformation(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4; + static multiplyByMatrix3(matrix: Matrix4, rotation: Matrix3, result: Matrix4): Matrix4; + static multiplyByTranslation(matrix: Matrix4, translation: Cartesian3, result: Matrix4): Matrix4; + static multiplyByUniformScale(matrix: Matrix4, scale: number, result: Matrix4): Matrix4; + static multiplyByScale(matrix: Matrix4, scale: Cartesian3, result: Matrix4): Matrix4; + static multiplyByVector(matrix: Matrix4, cartesian: Cartesian4, result: Cartesian4): Cartesian4; + static multiplyByPointAsVector(matrix: Matrix4, cartesian: Cartesian3, result: Cartesian3): Cartesian3; + static multiplyByPoint(matrix: Matrix4, cartesian: Cartesian3, result: Cartesian3): Cartesian3; + static multiplyByScalar(matrix: Matrix4, scalar: number, result: Matrix4): Matrix4; + static negate(matrix: Matrix4, result: Matrix4): Matrix4; + static transpose(matrix: Matrix4, result: Matrix4): Matrix4; + static abs(matrix: Matrix4, result: Matrix4): Matrix4; + static equals(left?: Matrix4, right?: Matrix4): boolean; + static equalsEpsilon(left: Matrix4, right: Matrix4, epsilon: number): boolean; + static getTranslation(matrix: Matrix4, result: Cartesian3): Cartesian3; + static getRotation(matrix: Matrix4, result: Matrix3): Matrix3; + static inverse(matrix: Matrix4, result: Matrix4): Matrix4; + static inverseTransformation(matrix: Matrix4, result: Matrix4): Matrix4; + } + + class NearFarScalar extends Packable { + near: number; + nearValue: number; + far: number; + farValue: number; + constructor(near?: number, nearValue?: number, far?: number, farValue?: number); + clone(result?: NearFarScalar): NearFarScalar; + equals(right?: NearFarScalar): boolean; + static clone(nearFarScalar: NearFarScalar, result?: NearFarScalar): NearFarScalar; + static pack(value: NearFarScalar, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: NearFarScalar): NearFarScalar; + static equals(left?: NearFarScalar, right?: NearFarScalar): boolean; + } + + class ObjectOrientedBoundingBox { + rotation: Matrix3; + translation: Cartesian3; + scale: Cartesian3; + constructor(rotation?: Matrix3, translation?: Cartesian3, scale?: Cartesian3); + clone(result?: ObjectOrientedBoundingBox): ObjectOrientedBoundingBox; + equals(right?: ObjectOrientedBoundingBox): boolean; + static fromPoints(positions: Cartesian3[], result?: ObjectOrientedBoundingBox): ObjectOrientedBoundingBox; + static fromBoundingRectangle(boundingRectangle: BoundingRectangle, rotation?: number): ObjectOrientedBoundingBox; + static clone(box: ObjectOrientedBoundingBox, result?: ObjectOrientedBoundingBox): ObjectOrientedBoundingBox; + static intersect(left: ObjectOrientedBoundingBox, right: ObjectOrientedBoundingBox): boolean; + static equals(left: ObjectOrientedBoundingBox, right: ObjectOrientedBoundingBox): boolean; + } + + class Occluder { + position: Cartesian3; + radius: number; + cameraPosition: Cartesian3; + constructor(occluderBoundingSphere: BoundingSphere, cameraPosition: Cartesian3); + isPointVisible(occludee: Cartesian3): boolean; + isBoundingSphereVisible(occludee: BoundingSphere): boolean; + computeVisibility(occludeeBS: BoundingSphere): number; + static fromBoundingSphere(occluderBoundingSphere: BoundingSphere, cameraPosition: Cartesian3, result?: Occluder): Occluder; + static computeOccludeePoint(occluderBoundingSphere: BoundingSphere, occludeePosition: Cartesian3, positions: Cartesian3[]): any; + static computeOccludeePointFromRectangle(rectangle: Rectangle, ellipsoid?: Ellipsoid): any; + } + + class PinBuilder { + fromColor(color: Color, size: number): HTMLCanvasElement; + fromUrl(url: string, color: Color, size: number): HTMLCanvasElement | Promise; + fromMakiIconId(id: string, color: Color, size: number): HTMLCanvasElement | Promise; + fromText(text: string, color: Color, size: number): HTMLCanvasElement; + } + + class Plane { + normal: Cartesian3; + distance: number; + constructor(normal: Cartesian3, distance: number); + static fromPointNormal(point: Cartesian3, normal: Cartesian3, result?: Plane): Plane; + static getPointDistance(plane: Plane, point: Cartesian3): number; + } + + class PolygonGeometry extends Packable { + constructor(options: { + polygonHierarchy: PolygonHierarchy; + height?: number; + extrudedHeight?: number; + vertexFormat?: VertexFormat; + stRotation?: number; + ellipsoid?: Ellipsoid; + granularity?: number; + perPositionHeight?: boolean + }); + static fromPositions(options?: { + positions: Cartesian3[]; + height?: number; + extrudedHeight?: number; + vertexFormat?: VertexFormat; + stRotation?: number; + ellipsoid?: Ellipsoid; + granularity?: number; + perPositionHeight?: boolean; + closeTop?: boolean; + closeBottom?: boolean; + }): PolygonGeometry; + static unpack(array: number[], startingIndex?: number, result?: PolygonGeometry): PolygonGeometry; + static createGeometry(polygonGeometry: PolygonGeometry): Geometry; + } + + class PolygonHierarchy extends Property { + positions: Cartesian3[]; + holes: PolygonHierarchy[]; + constructor(positions?: Cartesian3[], holes?: PolygonHierarchy[]); + } + + class PolygonOutlineGeometry extends Packable { + constructor(options: { + polygonHierarchy: any; + height?: number; + extrudedHeight?: number; + vertexFormat?: VertexFormat; + ellipsoid?: Ellipsoid; + granularity?: number; + perPositionHeight?: boolean + }); + static unpack(array: number[], startingIndex?: number, result?: PolygonOutlineGeometry): PolygonOutlineGeometry; + static fromPositions(options?: { + positions: Cartesian3[]; + height?: number; + extrudedHeight?: number; + ellipsoid?: Ellipsoid; + granularity?: number; + perPositionHeight?: boolean; + }): PolygonOutlineGeometry; + static createGeometry(polygonGeometry: PolygonOutlineGeometry): Geometry; + } + + class PolylineGeometry extends Packable { + constructor(options: { positions: Cartesian3[]; width?: number; colors?: Color[]; colorsPerVertex?: boolean; followSurface?: boolean; granularity?: number; ellipsoid?: Ellipsoid }); + static unpack(array: number[], startingIndex?: number, result?: PolylineGeometry): PolylineGeometry; + static createGeometry(polylineGeometry: PolylineGeometry): Geometry; + } + + class PolylineVolumeGeometry extends Packable { + constructor(options: { polylinePositions: Cartesian3[]; shapePositions: Cartesian2[]; ellipsoid?: Ellipsoid; granularity?: number; vertexFormat?: VertexFormat; cornerType?: CornerType }); + static unpack(array: number[], startingIndex?: number, result?: PolylineVolumeGeometry): PolylineVolumeGeometry; + static createGeometry(polylineVolumeGeometry: PolylineVolumeGeometry): Geometry; + } + + class PolylineVolumeOutlineGeometry extends Packable { + constructor(options: { polylinePositions: Cartesian3[]; shapePositions: number; ellipsoid?: Ellipsoid; granularity?: number; cornerType?: CornerType }); + static unpack(array: number[], startingIndex?: number, result?: PolylineVolumeOutlineGeometry): PolylineVolumeOutlineGeometry; + static createGeometry(polylineVolumeOutlineGeometry: PolylineVolumeOutlineGeometry): Geometry; + } + + class QuantizedMeshTerrainData { + waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement; + constructor(options: { + quantizedVertices: Uint16Array; + indices: Uint16Array | Uint32Array; + minimumHeight: number; + maximumHeight: number; + boundingSphere: BoundingSphere; + horizonOcclusionPoint: Cartesian3; + westIndices: number[]; + southIndices: number[]; + eastIndices: number[]; + northIndices: number[]; + westSkirtHeight: number; + southSkirtHeight: number; + eastSkirtHeight: number; + northSkirtHeight: number; + childTileMask?: number; + createdByUpsampling?: boolean; + encodedNormals?: Uint8Array; + waterMask?: Uint8Array + }); + 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; + interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number; + isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean; + wasCreatedByUpsampling(): boolean; + } + + class Quaternion extends Packable { + x: number; + y: number; + z: number; + w: number; + static packedInterpolationLength: number; + static ZERO: Quaternion; + static IDENTITY: Quaternion; + constructor(x?: number, y?: number, z?: number, w?: number); + clone(result?: Quaternion): Quaternion; + equals(right?: Quaternion): boolean; + equalsEpsilon(right: Quaternion, epsilon: number): boolean; + toString(): string; + static fromAxisAngle(axis: Cartesian3, angle: number, result?: Quaternion): Quaternion; + static fromRotationMatrix(matrix: Matrix3, result?: Quaternion): Quaternion; + static fromHeadingPitchRoll(heading: number, pitch: number, roll: number, result: Quaternion): Quaternion; + static pack(value: Quaternion, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: Quaternion): Quaternion; + static convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void; + static unpackInterpolationResult(array: number[], sourceArray: number[], startingIndex?: number, lastIndex?: number, result?: Quaternion): Quaternion; + static clone(quaternion: Quaternion, result?: Quaternion): Quaternion; + static conjugate(quaternion: Quaternion, result: Quaternion): Quaternion; + static magnitudeSquared(quaternion: Quaternion): number; + static magnitude(quaternion: Quaternion): number; + static normalize(quaternion: Quaternion, result: Quaternion): Quaternion; + static inverse(quaternion: Quaternion, result: Quaternion): Quaternion; + static add(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion; + static subtract(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion; + static negate(quaternion: Quaternion, result: Quaternion): Quaternion; + static dot(left: Quaternion, right: Quaternion): number; + static multiply(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion; + static multiplyByScalar(quaternion: Quaternion, scalar: number, result: Quaternion): Quaternion; + static divideByScalar(quaternion: Quaternion, scalar: number, result: Quaternion): Quaternion; + static computeAxis(quaternion: Quaternion, result: Cartesian3): Cartesian3; + static computeAngle(quaternion: Quaternion): number; + static lerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion; + static slerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion; + static log(quaternion: Quaternion, result: Cartesian3): Cartesian3; + static exp(cartesian: Cartesian3, result: Quaternion): Quaternion; + static computeInnerQuadrangle(q0: Quaternion, q1: Quaternion, q2: Quaternion, result: Quaternion): Quaternion; + static squad(q0: Quaternion, q1: Quaternion, s0: Quaternion, s1: Quaternion, t: number, result: Quaternion): Quaternion; + static fastSlerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion; + static fastSquad(q0: Quaternion, q1: Quaternion, s0: Quaternion, s1: Quaternion, t: number, result?: Quaternion): Quaternion; + static equals(left?: Quaternion, right?: Quaternion): boolean; + static equalsEpsilon(left: Quaternion, right: Quaternion, epsilon: number): boolean; + } + + class QuaternionSpline { + times: number[]; + points: Quaternion[]; + innerQuadrangles: Quaternion[]; + constructor(options: { times: number[]; points: Quaternion[]; firstInnerQuadrangle?: Quaternion; lastInnerQuadrangle?: Quaternion }); + findTimeInterval(time: number): number; + evaluate(time: number, result?: Quaternion): Quaternion; + } + + class Queue { + readonly length: number; + enqueue(item: any): void; + dequeue(): any; + contains(item: any): boolean; + clear(): void; + peek(): any; + sort(compareFunction: Queue.Comparator): void; + } + + namespace Queue { + type Comparator = (a: any, b: any) => number; + } + + class Ray { + origin: Cartesian3; + direction: Cartesian3; + constructor(origin?: Cartesian3, direction?: Cartesian3); + static getPoint(t: number, result?: Cartesian3): Cartesian3; + } + + class Rectangle extends Packable { + west: number; + south: number; + east: number; + north: number; + width: number; + height: number; + static MAX_VALUE: Rectangle; + constructor(west?: number, south?: number, east?: number, north?: number); + clone(result?: Rectangle): Rectangle; + equals(other?: Rectangle): boolean; + equalsEpsilon(other: Rectangle, epsilon: number): boolean; + static pack(value: Rectangle, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: Rectangle): Rectangle; + static computeWidth(rectangle: Rectangle): number; + static computeHeight(rectangle: Rectangle): number; + static fromDegrees(west?: number, south?: number, east?: number, north?: number, result?: Rectangle): Rectangle; + static fromCartographicArray(cartographics: Cartographic[], result?: Rectangle): Rectangle; + static clone(rectangle: Rectangle, result?: Rectangle): Rectangle; + static equals(left?: Rectangle, right?: Rectangle): boolean; + static validate(rectangle: Rectangle): void; + static southwest(rectangle: Rectangle, result?: Cartographic): Cartographic; + static northwest(rectangle: Rectangle, result?: Cartographic): Cartographic; + static northeast(rectangle: Rectangle, result?: Cartographic): Cartographic; + static southeast(rectangle: Rectangle, result?: Cartographic): Cartographic; + static center(rectangle: Rectangle, result?: Cartographic): Cartographic; + static intersection(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle; + static contains(rectangle: Rectangle, cartographic: Cartographic): boolean; + static subsample(rectangle: Rectangle, ellipsoid?: Ellipsoid, surfaceHeight?: number, result?: Cartesian3[]): Cartesian3[]; + } + + class RectangleGeometry extends Packable { + constructor(options: { + rectangle: Rectangle; + vertexFormat?: VertexFormat; + ellipsoid?: Ellipsoid; + granularity?: number; + height?: number; + rotation?: number; + stRotation?: number; + extrudedHeight?: number + }); + static pack(value: BoundingSphere, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: RectangleGeometry): RectangleGeometry; + static createGeometry(rectangleGeometry: RectangleGeometry): Geometry; + } + + class RectangleOutlineGeometry extends Packable { + constructor(options: { + rectangle: Rectangle; + ellipsoid?: Ellipsoid; + granularity?: number; + height?: number; + rotation?: number; + extrudedHeight?: number + }); + static pack(value: BoundingSphere, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: RectangleGeometry): RectangleOutlineGeometry; + static createGeometry(rectangleGeometry: RectangleOutlineGeometry): Geometry; + } + + class RequestErrorEvent { + statusCode: number; + response: any; + responseHeaders: any; + constructor(statusCode?: number, response?: any, responseHeaders?: string | object); + toString(): string; + } + + class RuntimeError { + name: string; + message: string; + stack: string; + constructor(message?: string); + } + + class ScreenSpaceEventHandler { + constructor(element?: HTMLCanvasElement); + setInputAction(action: () => void, type: number, modifier?: number): void; + getInputAction(type: number, modifier?: number): () => void; + removeInputAction(type: number, modifier?: number): void; + isDestroyed(): boolean; + destroy(): void; + } + + class ShowGeometryInstanceAttribute { + value: Uint8Array; + componentDatatype: ComponentDatatype; + componentsPerAttribute: number; + normalize: boolean; + constructor(show?: boolean); + static toValue(show: boolean, result?: Uint8Array): Uint8Array; + } + + class SimplePolylineGeometry extends Packable { + constructor(options: { positions: Cartesian3[]; colors?: Color[]; colorsPerVertex?: boolean; followSurface?: boolean; granularity?: number; ellipsoid?: Ellipsoid }); + static unpack(array: number[], startingIndex?: number, result?: SimplePolylineGeometry): SimplePolylineGeometry; + static createGeometry(simplePolylineGeometry: SimplePolylineGeometry): Geometry; + } + + class SphereGeometry extends Packable { + constructor(options?: { radius?: number; stackPartitions?: number; slicePartitions?: number; vertexFormat?: VertexFormat }); + static unpack(array: number[], startingIndex?: number, result?: SphereGeometry): SphereGeometry; + static createGeometry(sphereGeometry: SphereGeometry): Geometry; + } + + class SphereOutlineGeometry extends Packable { + constructor(options?: { radius?: number; stackPartitions?: number; slicePartitions?: number; subdivisions?: number }); + static unpack(array: number[], startingIndex?: number, result?: SphereOutlineGeometry): SphereOutlineGeometry; + static createGeometry(sphereGeometry: SphereOutlineGeometry): Geometry; + } + + class Spherical { + constructor(clock?: number, cone?: number, magnitude?: number); + equals(other: Spherical): boolean; + clone(result?: Spherical): Spherical; + equalsEpsilon(other: Spherical, epsilon: number): boolean; + toString(): string; + static fromCartesian3(cartesian3: Cartesian3, spherical?: Spherical): Spherical; + static clone(spherical: Spherical, result?: Spherical): Spherical; + static normalize(spherical: Spherical, result?: Spherical): Spherical; + static equals(left: Spherical, right: Spherical): boolean; + static equalsEpsilon(left: Spherical, right: Spherical, epsilon?: number): boolean; + } + + class Spline { + times: number[]; + points: Cartesian3[] | Quaternion[]; + evaluate(time: number, result?: Cartesian3 | Quaternion): Cartesian3 | Quaternion; + findTimeInterval(time: number, startIndex: number): number; + } + + class TaskProcessor { + constructor(workerName: string, maximumActiveTasks?: number); + scheduleTask(parameters: any, transferableObjects?: any[]): Promise; + isDestroyed(): boolean; + destroy(): void; + } + + class TerrainData { + 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; + } + + class TerrainMesh { + center: Cartesian3; + vertices: Float32Array; + stride: number; + indices: Uint16Array | Uint32Array; + minimumHeight: number; + maximumHeight: number; + boundingSphere3D: BoundingSphere; + occludeePointInScaledSpace: Cartesian3; + constructor(center: Cartesian3, vertices: Float32Array, indices: Uint16Array | Uint32Array, minimumHeight: number, + maximumHeight: number, boundingSphere3D: BoundingSphere, occludeePointInScaledSpace: Cartesian3, vertexStride?: number); + } + + abstract class TerrainProvider { + availability: any; // TileAvailability + credit: Credit; + errorEvent: Event; + hasVertexNormals: boolean; + hasWaterMask: boolean; + ready: boolean; + readonly readyPromise: Promise; + tilingScheme: TilingScheme; + static heightmapTerrainQuality: number; + 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, throttleRequests?: boolean): Promise; + } + + class TileProviderError { + provider: ImageryProvider | TerrainProvider; + message: string; + x: number; + y: number; + level: number; + timesRetried: number; + retry: boolean; + error: Error; + constructor(provider: ImageryProvider | TerrainProvider, message: string, x?: number, y?: number, level?: number, timesRetried?: number, error?: Error); + static handleError(previousError: TileProviderError, provider: ImageryProvider | TerrainProvider, event: Event, + message: string, x: number, y: number, level: number, retryFunction: TileProviderError.RetryFunction, + errorDetails?: Error): TileProviderError; + static handleSuccess(previousError: TileProviderError): void; + } + + namespace TileProviderError { + type RetryFunction = () => void; + } + + class TilingScheme { + ellipsoid: Ellipsoid; + rectangle: Rectangle; + projection: MapProjection; + getNumberOfXTilesAtLevel(level: number): number; + getNumberOfYTilesAtLevel(level: number): number; + rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle; + tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle; + tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle; + positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2; + } + + class TimeInterval { + start: JulianDate; + stop: JulianDate; + data: any; + isStartIncluded: boolean; + isStopIncluded: boolean; + isEmpty: boolean; + static EMPTY: TimeInterval; + constructor(options?: { start?: JulianDate; stop?: JulianDate; isStartIncluded?: boolean; isStopIncluded?: boolean; data?: any }); + clone(result?: TimeInterval): TimeInterval; + equals(right?: TimeInterval, dataComparer?: TimeInterval.DataComparer): boolean; + equalsEpsilon(right: TimeInterval, epsilon: number, dataComparer?: TimeInterval.DataComparer): boolean; + toString(): string; + static fromIso8601(options: { iso8601: string; isStartIncluded?: boolean; isStopIncluded?: boolean; data?: any }, result?: TimeInterval): TimeInterval; + static toIso8601(timeInterval: TimeInterval, precision?: number): string; + static clone(timeInterval?: TimeInterval, result?: TimeInterval): TimeInterval; + static equals(left?: TimeInterval, right?: TimeInterval, dataComparer?: TimeInterval.DataComparer): boolean; + static equalsEpsilon(left: TimeInterval, right: TimeInterval, epsilon: number, dataComparer?: TimeInterval.DataComparer): boolean; + static intersect(left: TimeInterval, right: TimeInterval, result: TimeInterval, mergeCallback?: TimeInterval.MergeCallback): TimeInterval; + static contains(timeInterval: TimeInterval, julianDate: JulianDate): boolean; + } + + namespace TimeInterval { + type MergeCallback = (leftData: any, rightData: any) => any; + type DataComparer = (leftData: any, rightData: any) => boolean; + } + + class TimeIntervalCollection { + readonly changedEvent: Event; + readonly start: JulianDate; + readonly isStartIncluded: boolean; + readonly stop: JulianDate; + readonly isStopIncluded: boolean; + readonly length: number; + readonly isEmpty: boolean; + constructor(intervals?: TimeInterval[]); + equals(right?: TimeIntervalCollection, dataComparer?: TimeInterval.DataComparer): boolean; + get(index: number): TimeInterval; + removeAll(): void; + findIntervalContainingDate(date: JulianDate): TimeInterval | undefined; + findDataForIntervalContainingDate(date: JulianDate): any; + contains(julianDate: JulianDate): boolean; + indexOf(date: JulianDate): number; + findInterval(options?: { start?: JulianDate; stop?: JulianDate; isStartIncluded?: boolean; isStopIncluded?: boolean }): TimeInterval; + addInterval(interval: TimeInterval, dataComparer?: TimeInterval.DataComparer): void; + removeInterval(interval: TimeInterval): void; + intersect(other: TimeIntervalCollection, dataComparer?: TimeInterval.DataComparer, mergeCallback?: TimeInterval.MergeCallback): TimeIntervalCollection; + } + + class VRTheWorldTerrainProvider extends TerrainProvider { + constructor(options: { url: string; proxy?: any; ellipsoid?: Ellipsoid; credit?: Credit | string }); + } + + class VertexFormat extends Packable { + position: boolean; + normal: boolean; + st: boolean; + binormal: boolean; + tangent: boolean; + color: boolean; + static POSITION_ONLY: VertexFormat; + static POSITION_AND_NORMAL: VertexFormat; + static POSITION_NORMAL_AND_ST: VertexFormat; + static POSITION_AND_ST: VertexFormat; + static POSITION_AND_COLOR: VertexFormat; + static ALL: VertexFormat; + static DEFAULT: VertexFormat; + constructor(options?: any); + static unpack(array: number[], startingIndex?: number, result?: VertexFormat): VertexFormat; + static clone(cartesian: VertexFormat, result?: VertexFormat): VertexFormat; + } + + class WallGeometry extends Packable { + constructor(options: { positions: Cartesian3[]; granularity?: number; maximumHeights?: number[]; minimumHeights?: number[]; ellipsoid?: Ellipsoid; vertexFormat?: VertexFormat }); + static unpack(array: number[], startingIndex?: number, result?: WallGeometry): WallGeometry; + static fromConstantHeights(positions: Cartesian3[], maximumHeight?: number, minimumHeight?: number, ellipsoid?: Ellipsoid): WallGeometry; + static createGeometry(wallGeometry: WallGeometry): Geometry; + } + + class WallOutlineGeometry extends Packable { + constructor(options: { positions: Cartesian3[]; granularity?: number; maximumHeights?: number[]; minimumHeights?: number[]; ellipsoid?: Ellipsoid }); + static unpack(array: number[], startingIndex?: number, result?: WallOutlineGeometry): WallOutlineGeometry; + static fromConstantHeights(positions: Cartesian3[], maximumHeight?: number, minimumHeight?: number, ellipsoid?: Ellipsoid): WallOutlineGeometry; + static createGeometry(wallGeometry: WallOutlineGeometry): Geometry; + } + + class WebMercatorProjection { + ellipsoid: Ellipsoid; + static MaximumLatitude: number; + constructor(ellipsoid?: Ellipsoid); + project(cartographic: Cartographic, result?: Cartesian3): Cartesian3; + unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic; + static mercatorAngleToGeodeticLatitude(mercatorAngle: number): number; + static geodeticLatitudeToMercatorAngle(latitude: number): number; + } + + class WebMercatorTilingScheme { + ellipsoid: Ellipsoid; + rectangle: Rectangle; + projection: MapProjection; + constructor(options?: { ellipsoid?: Ellipsoid; + numberOfLevelZeroTilesX?: number; + numberOfLevelZeroTilesY?: number; + rectangleSouthwestInMeters?: Cartesian2; + rectangleNortheastInMeters?: Cartesian2 + }); + getNumberOfXTilesAtLevel(level: number): number; + getNumberOfYTilesAtLevel(level: number): number; + rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle; + tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle; + tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle; + positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2; + } + + class BillboardGraphics { + definitionChanged: Event; + image: Property; + imageSubRegion: Property; + scale: Property; + rotation: Property; + alignedAxis: Property; + horizontalOrigin: Property; + verticalOrigin: Property; + color: Property; + eyeOffset: Property; + pixelOffset: Property; + show: Property; + width: Property; + height: Property; + scaleByDistance: Property; + translucencyByDistance: Property; + pixelOffsetScaleByDistance: Property; + constructor(options?: { image?: Property; + show?: Property; + scale?: Property; + horizontalOrigin?: Property; + verticalOrigin?: Property; + eyeOffset?: Property; + pixelOffset?: Property; + rotation?: Property; + alignedAxis?: Property; + width?: Property; + height?: Property; + color?: Property; + scaleByDistance?: Property; + translucencyByDistance?: Property; + pixelOffsetScaleByDistance?: Property; + imageSubRegion?: Property + }); + clone(result?: BillboardGraphics): BillboardGraphics; + merge(source: BillboardGraphics): BillboardGraphics; + } + + class BillboardVisualizer extends Visualizer { + constructor(entityCluster: EntityCluster, entityCollection: EntityCollection); + } + + class BoxGeometryUpdater extends GeometryUpdater { + constructor(entity: Entity, scene: Scene); + } + + class BoxGraphics { + definitionChanged: Event; + show: Property; + dimensions: Property; + material: MaterialProperty; + fill: Property; + outline: Property; + outlineColor: Property; + outlineWidth: Property; + constructor(options?: { + dimensions?: Property; + show?: Property; + fill?: Property; + material?: MaterialProperty; + outline?: Property; + outlineColor?: Property; + outlineWidth?: Property + }); + clone(result?: BoxGraphics): BoxGraphics; + merge(source: BoxGraphics): BoxGraphics; + } + + class CallbackProperty extends Property { + constructor(callback: CallbackProperty.Callback, isConstant: boolean); + setCallback(callback: CallbackProperty.Callback, isConstant: boolean): void; + } + + namespace CallbackProperty { + type Callback = (time?: JulianDate, result?: any) => any; + } + + class CheckerboardMaterialProperty extends MaterialProperty { + evenColor: Color; + oddColor: Color; + repeat: Property; + constructor(options?: { evenColor?: Color; oddColor?: Color; repeat?: Property }); + } + + class ColorMaterialProperty extends MaterialProperty { + color: Color; + constructor(color?: Color); + } + + class CompositeEntityCollection { + collectionChanged: Event; + id: string; + values: Entity[]; + constructor(collections?: EntityCollection[]); + addCollection(collection: EntityCollection, index?: number): void; + removeCollection(collection: EntityCollection): boolean; + removeAllCollections(): void; + containsCollection(collection: EntityCollection): boolean; + contains(entity: Entity): boolean; + indexOfCollection(collection: EntityCollection): number; + getCollection(index: number): EntityCollection; + getCollectionsLength(): number; + raiseCollection(collection: EntityCollection): void; + lowerCollection(collection: EntityCollection): void; + raiseCollectionToTop(collection: EntityCollection): void; + lowerCollectionToBottom(collection: EntityCollection): void; + suspendEvents(): void; + resumeEvents(): void; + computeAvailability(): TimeInterval; + getById(id: any): Entity; + } + + class CompositeMaterialProperty extends MaterialProperty { + intervals: TimeIntervalCollection; + } + + class CompositePositionProperty { + isConstant: boolean; + definitionChanged: Event; + intervals: TimeIntervalCollection; + referenceFrame: ReferenceFrame; + getValue(time: JulianDate, result?: any): any; + getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3; + equals(other?: Property): boolean; + } + + class CompositeProperty extends Property { + intervals: TimeIntervalCollection; + } + + class ConstantPositionProperty { + isConstant: boolean; + definitionChanged: Event; + referenceFrame: ReferenceFrame; + constructor(value?: Cartesian3, referenceFrame?: ReferenceFrame); + getValue(time: JulianDate, result?: any): any; + setValue(value: Cartesian3, referenceFrame?: ReferenceFrame): void; + getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3; + equals(other?: Property): boolean; + } + + class ConstantProperty extends Property { + constructor(value?: any); + setValue(value: any): void; + } + + class CorridorGeometryUpdater extends GeometryUpdater { + constructor(entity: Entity, scene: Scene); + } + + class CorridorGraphics { + definitionChanged: Event; + show: Property; + material: MaterialProperty; + positions: Property; + height: Property; + extrudedHeight: Property; + granularity: Property; + width: Property; + fill: Property; + outline: Property; + outlineColor: Property; + outlineWidth: Property; + cornerType: Property; + constructor(options?: { + positions?: Property; + width?: Property; + cornerType?: Property; + height?: Property; + extrudedHeight?: Property; + show?: Property; + fill?: Property; + material?: MaterialProperty; + outline?: Property; + outlineColor?: Property; + outlineWidth?: Property; + granularity?: Property + }); + clone(result?: CorridorGraphics): CorridorGraphics; + merge(source: CorridorGraphics): CorridorGraphics; + } + + class CustomDataSource extends DataSource { + constructor(name?: string); + } + + class CylinderGeometryUpdater extends GeometryUpdater { + constructor(entity: Entity, scene: Scene); + } + + class CylinderGraphics { + definitionChanged: Event; + length: Property; + topRadius: Property; + bottomRadius: Property; + numberOfVerticalLines: Property; + slices: Property; + show: Property; + material: MaterialProperty; + fill: Property; + outline: Property; + outlineColor: Property; + outlineWidth: Property; + constructor(options?: { length?: Property; + topRadius?: Property; + bottomRadius?: Property; + show?: Property; + fill?: Property; + material?: MaterialProperty; + outline?: Property; + outlineColor?: Property; + outlineWidth?: Property; + numberOfVerticalLines?: Property; + slices?: Property + }); + clone(result?: CylinderGraphics): CylinderGraphics; + merge(source: CylinderGraphics): CylinderGraphics; + } + + class CzmlDataSource extends DataSource { + static updaters: any[]; + static load(czml: Resource | string | object, options?: { sourceUri?: string }): Promise; + static processMaterialPacketData(object: object, propertyName: string, packetData: object, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void; + static processPacketData(type: () => any, object: object, propertyName: string, packetData: object, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void; + static processPositionPacketData(object: object, propertyName: string, packetData: object, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void; + constructor(name?: string); + load(czml: Resource | string | object, options?: { sourceUri?: string }): Promise; + process(czml: Resource | string | object, options?: { sourceUri?: string }): Promise; + } + + abstract class DataSource { + changedEvent: Event; + clock: DataSourceClock; + clustering: EntityCluster; + entities: EntityCollection; + errorEvent: Event; + isLoading: boolean; + loadingEvent: Event; + name: string; + show: boolean; + update(time: JulianDate): boolean; + } + + class DataSourceClock { + definitionChanged: Event; + startTime: JulianDate; + stopTime: JulianDate; + currentTime: JulianDate; + clockRange: ClockRange; + clockStep: ClockStep; + multiplier: number; + clone(result?: DataSourceClock): DataSourceClock; + equals(other: DataSourceClock): boolean; + merge(source: DataSourceClock): DataSourceClock; + getValue(): Clock; + } + + class DataSourceCollection { + length: number; + dataSourceAdded: Event; + dataSourceRemoved: Event; + add(dataSource: DataSource | Promise): Promise; + remove(dataSource: DataSource, destroy?: boolean): boolean; + removeAll(destroy?: boolean): void; + contains(dataSource: DataSource): boolean; + indexOf(dataSource: DataSource): number; + get(index: number): DataSource; + isDestroyed(): boolean; + destroy(): void; + } + + class DataSourceDisplay { + scene: Scene; + dataSources: DataSourceCollection; + defaultDataSource: CustomDataSource; + static defaultVisualizersCallback: DataSourceDisplay.VisualizersCallback; + constructor(options: { scene: Scene; dataSourceCollection: DataSourceCollection; visualizersCallback?: DataSourceDisplay.VisualizersCallback }); + isDestroyed(): boolean; + destroy(): void; + update(time: JulianDate): boolean; + } + + namespace DataSourceDisplay { + type VisualizersCallback = (scene: Scene, dataSource: DataSource) => Visualizer[]; + } + + class DynamicGeometryUpdater { + update(time: JulianDate): void; + isDestroyed(): boolean; + destroy(): void; + } + + class EllipseGeometryUpdater extends GeometryUpdater { + readonly onTerrain: boolean; + constructor(entity: Entity, scene: Scene); + } + + class EllipseGraphics { + definitionChanged: Event; + semiMajorAxis: Property; + semiMinorAxis: Property; + rotation: Property; + show: Property; + material: MaterialProperty; + height: Property; + extrudedHeight: Property; + granularity: Property; + stRotation: Property; + fill: Property; + outline: Property; + outlineColor: Property; + outlineWidth: Property; + numberOfVerticalLines: Property; + constructor(options?: { + semiMajorAxis?: number; + semiMinorAxis?: number; + height?: Property; + extrudedHeight?: Property; + show?: Property; + fill?: Property; + material?: MaterialProperty; + outline?: Property; + outlineColor?: Property; + outlineWidth?: Property; + numberOfVerticalLines?: Property; + rotation?: Property; + stRotation?: Property; + granularity?: Property + }); + clone(result?: EllipseGraphics): EllipseGraphics; + merge(source: EllipseGraphics): EllipseGraphics; + } + + class EllipsoidGeometryUpdater extends GeometryUpdater { + constructor(entity: Entity, scene: Scene); + createFillGeometryInstance(time: JulianDate, skipModelMatrix?: boolean, modelMatrixResult?: Matrix4): GeometryInstance; + createOutlineGeometryInstance(time: JulianDate, skipModelMatrix?: boolean, modelMatrixResult?: Matrix4): GeometryInstance; + } + + class EllipsoidGraphics { + definitionChanged: Event; + show: Property; + radii: Property; + material: MaterialProperty; + fill: Property; + outline: Property; + outlineColor: Property; + outlineWidth: Property; + stackPartitions: Property; + slicePartitions: Property; + subdivisions: Property; + constructor(options?: { + radii?: Property; + show?: Property; + fill?: Property; + material?: MaterialProperty; + outline?: Property; + outlineColor?: Property; + outlineWidth?: Property; + subdivisions?: Property; + stackPartitions?: Property; + slicePartitions?: Property + }); + clone(result?: EllipsoidGraphics): EllipsoidGraphics; + merge(source: EllipsoidGraphics): EllipsoidGraphics; + } + + class Entity { + availability: TimeIntervalCollection; + billboard: BillboardGraphics; + box: BoxGraphics; + corridor: CorridorGraphics; + cylinder: CylinderGraphics; + readonly definitionChanged: Event; + description: Property; + ellipse: EllipseGraphics; + ellipsoid: EllipsoidGraphics; + entityCollection: EntityCollection; + id: string; + isShowing: boolean; + label: LabelGraphics; + model: ModelGraphics; + name: string; + orientation: Property; + parent: Entity; + path: PathGraphics; + plane: any; + point: PointGraphics; + polygon: PolygonGraphics; + polyline: PolylineGraphics; + polylineVolume: PolylineVolumeGraphics; + position: PositionProperty; + properties: any; + propertyNames: any[]; + rectangle: RectangleGraphics; + show: boolean; + viewFrom: Property; + wall: WallGraphics; + constructor(options?: { + id?: string; + name?: string; + availability?: TimeIntervalCollection; + show?: boolean; + description?: Property; + position?: PositionProperty; + orientation?: Property; + viewFrom?: Property; + parent?: Entity; + billboard?: BillboardGraphics; + box?: BoxGraphics; + corridor?: CorridorGraphics; + cylinder?: CylinderGraphics; + ellipse?: EllipseGraphics; + ellipsoid?: EllipsoidGraphics; + label?: LabelGraphics; + model?: ModelGraphics; + path?: PathGraphics; + plane?: any; + point?: PointGraphics; + polygon?: PolygonGraphics; + polyline?: PolylineGraphics; + polylineVolume?: PolylineVolumeGraphics; + rectangle?: RectangleGraphics; + wall?: WallGraphics + }); + addProperty(propertyName: string): void; + computeModelMatrix(time: JulianDate, result?: Matrix4): Matrix4; + isAvailable(time: JulianDate): boolean; + merge(source: Entity): Entity; + removeProperty(propertyName: string): void; + } + + class EntityCluster { + clusterBillboards: boolean; + clusterEvent: Event; + clusterLabels: boolean; + clusterPoints: boolean; + enabled: boolean; + minimumClusterSize: number; + pixelRange: number; + constructor(options?: { enabled?: boolean; pixelRange?: number; minimumClusterSize?: number; clusterBillboards?: boolean; clusterLabels?: boolean; clusterPoints?: boolean }); + destroy(): void; + // newClusterCallback(clusteredEntities, cluster) + } + + class EntityCollection { + readonly collectionChanged: Event; + readonly id: string; + readonly owner: DataSource | CompositeEntityCollection; + show: boolean; + readonly values: Entity[]; + static collectionChangedEventCallback(collection: EntityCollection, added: Entity[], removed: Entity[], changed: Entity[]): void; + constructor(owner: DataSource | CompositeEntityCollection); + add(entity: Entity): Entity; + computeAvailability(): TimeInterval; + contains(entity: Entity): boolean; + getById(id: string): Entity; + getOrCreateEntity(id: string): Entity; + remove(entity: Entity): boolean; + removeAll(): void; + removeById(id: string): boolean; + resumeEvents(): void; + suspendEvents(): void; + } + + class EntityView { + entity: Entity; + scene: Scene; + ellipsoid: Ellipsoid; + boundingSphere: Entity; + static defaultOffset3D: Cartesian3; + constructor(entity: Entity, scene: Scene, ellipsoid?: Ellipsoid, boundingSphere?: BoundingSphere); + update(time: JulianDate): void; + } + + class GeoJsonDataSource extends DataSource { + static clampToGround: boolean; + static crsLinkHrefs: any; + static crsLinkTypes: any; + static crsNames: any; + static fill: Color; + static markerColor: Color; + static markerSize: number; + static markerSymbol: string; + static stroke: Color; + static strokeWidth: number; + static load(data: Resource | string | object, options?: { + sourceUri?: string; + markerSize?: number; + markerSymbol?: string; + markerColor?: Color; + stroke?: Color; + strokeWidth?: number; + fill?: Color; + clampToGround?: boolean + }): Promise; + constructor(name?: string); + load(data: Resource | string | object, options?: { + sourceUri?: string; + markerSize?: number; + markerSymbol?: string; + markerColor?: Color; + stroke?: Color; + strokeWidth?: number; + fill?: Color; + clampToGround?: boolean + }): Promise; + } + + class GeometryUpdater { + readonly classificationTypeProperty: Property; + readonly readonlydistanceDisplayConditionProperty: Property; + readonly entity: Entity; + readonly fillEnabled: boolean; + readonly fillMaterialProperty: MaterialProperty; + readonly geometryChanged: boolean; + readonly hasConstantFill: boolean; + readonly hasConstantOutline: boolean; + readonly id: string; + readonly isClosed: boolean; + readonly isDynamic: boolean; + readonly outlineColorProperty: Property; + readonly outlineEnabled: boolean; + readonly outlineWidth: number; + readonly shadowsProperty: Property; + constructor(options: { entity: Entity; scene: Scene; geometryOptions: any; geometryPropertyName: string; observedPropertyNames: string[] }); + createDynamicUpdater(primitives: PrimitiveCollection, groundPrimitives: PrimitiveCollection): DynamicGeometryUpdater; + destroy(): void; + isDestroyed(): boolean; + isFilled(time: JulianDate): boolean; + isOutlineVisible(time: JulianDate): boolean; + createFillGeometryInstance(time: JulianDate): GeometryInstance; + createOutlineGeometryInstance(time: JulianDate): GeometryInstance; + } + + class GeometryVisualizer extends Visualizer { + constructor(scene: Scene, entityCollection: EntityCollection, primitives?: PrimitiveCollection, groundPrimitives?: PrimitiveCollection); + } + + class GridMaterialProperty extends MaterialProperty { + color: Color; + cellAlpha: Property; + lineCount: Property; + lineThickness: Property; + lineOffset: Property; + constructor(options?: { color?: Property; cellAlpha?: Property; lineCount?: Property; lineThickness?: Property; lineOffset?: Property }); + } + + class ImageMaterialProperty extends MaterialProperty { + image: Property; + repeat: Property; + constructor(options?: { image?: Property; repeat?: Property }); + } + + class KmlDataSource extends DataSource { + refreshEvent: Event; + unsupportedNodeEvent: Event; + constructor(options?: {camera?: Camera, canvas?: HTMLCanvasElement; ellipsoid?: Ellipsoid}); + static load(data: Resource | string | Document | Blob, + options?: { camera: Camera, canvas: HTMLCanvasElement; sourceUri?: string, clampToGround?: boolean; ellipsoid?: Ellipsoid }): Promise; + load(data: Resource | string | Document | Blob, options?: { sourceUri?: string, clampToGround?: boolean, ellipsoid?: Ellipsoid }): Promise; + } + + class KmlFeatureData { + author: { name: string; uri: string; email: string }; + link: { href: string; hreflang: string; rel: string; type: string; title: string; length: string }; + address: string; + phoneNumber: string; + snippet: string; + extendedData: string; + } + + class LabelGraphics { + definitionChanged: Event; + text: Property; + font: Property; + style: Property; + fillColor: Property; + outlineColor: Property; + outlineWidth: Property; + horizontalOrigin: Property; + verticalOrigin: Property; + eyeOffset: Property; + pixelOffset: Property; + scale: Property; + show: Property; + translucencyByDistance: Property; + pixelOffsetScaleByDistance: Property; + constructor(options?: { + text?: Property; + font?: Property; + style?: Property; + fillColor?: Property; + outlineColor?: Property; + outlineWidth?: Property; + show?: Property; + scale?: Property; + horizontalOrigin?: Property; + verticalOrigin?: Property; + eyeOffset?: Property; + pixelOffset?: Property; + translucencyByDistance?: Property; + pixelOffsetScaleByDistance?: Property + }); + clone(result?: LabelGraphics): LabelGraphics; + merge(source: LabelGraphics): LabelGraphics; + } + + class LabelVisualizer extends Visualizer { + constructor(entityCluster: EntityCluster, entityCollection: EntityCollection); + } + + class MaterialProperty extends Property { + getType(time: JulianDate): string; + } + + class ModelGraphics { + clampAnimations: Property | boolean; + clippingPlanes: Property; + color: Property; + colorBlendAmount: Property | number; + colorBlendMode: Property; + readonly definitionChanged: Event; + distanceDisplayCondition: Property; + heightReference: Property; + incrementallyLoadTextures: Property | boolean; + maximumScale: Property | number; + minimumScale: Property | number; + minimumPixelSize: Property | number; + nodeTransformations: any; // PropertyBag + runAnimations: Property | boolean; + scale: Property | number; + shadows: Property; + show: Property | boolean; + silhouetteColor: Property; + silhouetteSize: Property | number; + uri: Property | string; + constructor(options?: { + uri?: Property | string; + show?: Property | boolean; + scale?: Property | number; + minimumPixelSize?: Property | number; + maximumScale?: Property | number; + incrementallyLoadTextures?: Property | boolean; + runAnimations?: Property | boolean; + clampAnimations?: Property | boolean; + nodeTransformations?: Property; + shadows?: Property; + heightReference?: Property; + distanceDisplayCondition?: Property; + silhouetteColor?: Property; + silhouetteSize?: Property | number; + color?: Property; + colorBlendMode?: Property; + colorBlendAmount?: Property | number; + clippingPlanes?: Property; + }); + clone(result?: ModelGraphics): ModelGraphics; + merge(source: ModelGraphics): ModelGraphics; + } + + class ModelVisualizer extends Visualizer { + constructor(scene: Scene, entityCollection: EntityCollection); + } + + class PathGraphics { + readonly definitionChanged: Event; + distanceDisplayCondition: Property; + leadTime: Property | number; + material: MaterialProperty; + resolution: Property | number; + trailTime: Property | number; + show: Property | boolean; + width: Property | number; + constructor(options?: { + leadTime?: Property | number; + trailTime?: Property | number; + show?: Property | boolean; + width?: Property | number; + material?: MaterialProperty; + resolution?: Property | number; + distanceDisplayCondition?: Property; + }); + clone(result?: PathGraphics): PathGraphics; + merge(source: PathGraphics): PathGraphics; + } + + class PathVisualizer extends Visualizer { + constructor(scene: Scene, entityCollection: EntityCollection); + } + + class PointGraphics { + color: Property; + readonly definitionChanged: Event; + disableDepthTestDistance: Property; + distanceDisplayCondition: Property; + heightReference: Property; + outlineColor: Property; + outlineWidth: Property; + pixelSize: Property; + scaleByDistance: Property; + show: Property; + translucencyByDistance: Property; + constructor(options?: { + color?: Color; + pixelSize?: number; + outlineColor?: Color; + outlineWidth?: number; + show?: boolean; + scaleByDistance?: Property; + translucencyByDistance?: Property; + heightReference?: HeightReference; + distanceDisplayCondition?: Property; + disableDepthTestDistance?: Property + }); + clone(result?: PointGraphics): PointGraphics; + merge(source: PointGraphics): PointGraphics; + } + + class PointVisualizer extends Visualizer { + constructor(entityCluster: EntityCluster, entityCollection: EntityCollection); + } + + class PolygonGeometryUpdater extends GeometryUpdater { + constructor(entity: Entity, scene: Scene); + } + + class PolygonGraphics { + definitionChanged: Event; + show: Property; + material: MaterialProperty; + positions: Property; + hierarchy: Property; + height: Property; + extrudedHeight: Property; + granularity: Property; + stRotation: Property; + fill: Property; + outline: Property; + outlineColor: Property; + outlineWidth: Property; + perPositionHeight: Property; + constructor(options?: { + hierarchy?: Property; + height?: number; + extrudedHeight?: Property; + show?: Property; + fill?: Property; + material?: MaterialProperty; + outline?: boolean; + outlineColor?: Property; + outlineWidth?: number; + stRotation?: Property; + granularity?: Property; + perPositionHeight?: Property + }); + clone(result?: PolygonGraphics): PolygonGraphics; + merge(source: PolygonGraphics): PolygonGraphics; + } + + class PolylineArrowMaterialProperty extends MaterialProperty { + color: Property; + constructor(color?: Property); + } + + class PolylineGeometryUpdater extends GeometryUpdater { + readonly depthFailMaterialProperty: MaterialProperty; + readonly distanceDisplayConditionProperty: Property; + constructor(entity: Entity, scene: Scene); + } + + class PolylineGlowMaterialProperty extends MaterialProperty { + color: Color; + glowPower: Property; + constructor(options?: { color?: Property; glowPower?: Property }); + } + + class PolylineGraphics { + definitionChanged: Event; + show: Property; + material: MaterialProperty; + positions: Property; + width: number; + followSurface: Property; + granularity: Property; + constructor(options?: { positions?: Cartesian3[]; followSurface?: Property; width?: number; show?: Property; material?: MaterialProperty; granularity?: Property }); + clone(result?: PolylineGraphics): PolylineGraphics; + merge(source: PolylineGraphics): PolylineGraphics; + } + + class PolylineOutlineMaterialProperty extends MaterialProperty { + color: Color; + outlineColor: Color; + outlineWidth: Property; + constructor(options?: { color?: Property; outlineColor?: Property; outlineWidth?: Property }); + } + + class PolylineVolumeGeometryUpdater extends GeometryUpdater { + constructor(entity: Entity, scene: Scene); + } + + class PolylineVolumeGraphics { + definitionChanged: Event; + show: Property; + material: MaterialProperty; + positions: Property; + shape: Property; + granularity: Property; + fill: Property; + outline: Property; + outlineColor: Property; + outlineWidth: Property; + cornerType: Property; + constructor(options?: { + positions?: Property; + shape?: Property; + cornerType?: Property; + show?: Property; + fill?: Property; + material?: MaterialProperty; + outline?: Property; + outlineColor?: Property; + outlineWidth?: Property; + granularity?: Property + }); + clone(result?: PolylineVolumeGraphics): PolylineVolumeGraphics; + merge(source: PolylineVolumeGraphics): PolylineVolumeGraphics; + } + + abstract class PositionProperty extends Property { + referenceFrame: ReferenceFrame; + getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3; + } + + class PositionPropertyArray extends PositionProperty { + constructor(value?: Property[]); + getValue(time?: JulianDate, result?: Cartesian3[]): Cartesian3[]; + setValue(value: Property[]): void; + } + + abstract class Property { + readonly isConstant: boolean; + readonly definitionChanged: Event; + getValue(time: JulianDate, result?: any): any; + equals(other?: Property): boolean; + } + + class PropertyArray extends Property { + constructor(value?: Property[]); + getValue(time?: JulianDate, result?: any[]): any[]; + setValue(value: Property[]): void; + } + + class RectangleGeometryUpdater extends GeometryUpdater { + constructor(entity: Entity, scene: Scene); + } + + class RectangleGraphics { + definitionChanged: Event; + show: Property; + coordinates: Property; + material: MaterialProperty; + height: Property; + extrudedHeight: Property; + granularity: Property; + stRotation: Property; + rotation: Property; + fill: Property; + outline: Property; + outlineColor: Property; + outlineWidth: Property; + closeTop: Property; + closeBottom: Property; + constructor(options?: { + coordinates?: Property; + height?: Property; + extrudedHeight?: Property; + closeTop?: Property; + closeBottom?: Property; + show?: Property; + fill?: Property; + material?: MaterialProperty; + outline?: Property; + outlineColor?: Property; + outlineWidth?: Property; + rotation?: Property; + stRotation?: Property; + granularity?: Property + }); + clone(result?: RectangleGraphics): RectangleGraphics; + merge(source: RectangleGraphics): RectangleGraphics; + } + + class ReferenceProperty extends Property { + readonly referenceFrame: ReferenceFrame; + readonly targetId: string; + readonly targetCollection: EntityCollection; + readonly targetPropertyNames: string[]; + readonly resolvedProperty: Property; + constructor(targetCollection: EntityCollection, targetId: string, targetPropertyNames: string); + getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3; + getType(time: JulianDate): string; + static fromString(targetCollection: Entity, referenceString: string): ReferenceProperty; + } + + class SampledPositionProperty extends SampledProperty { + numberOfDerivatives: boolean; + constructor(referenceFrame?: ReferenceFrame, numberOfDerivatives?: number); + addSample(time: JulianDate, position: Cartesian3, derivatives?: Cartesian3[]): void; + addSamples(times: JulianDate[], positions: Cartesian3[], derivatives?: any[][]): void; + addSamplesPackedArray(packedSamples: number[], epoch?: JulianDate): void; + } + + class SampledProperty extends PositionProperty { + type: any; + derivativeTypes: Packable[]; + interpolationDegree: number; + interpolationAlgorithm: InterpolationAlgorithm; + forwardExtrapolationType: ExtrapolationType; + forwardExtrapolationDuration: number; + backwardExtrapolationType: ExtrapolationType; + backwardExtrapolationDuration: number; + constructor(type: number | Packable, derivativeTypes?: Packable[]); + setInterpolationOptions(options?: { interpolationAlgorithm?: InterpolationAlgorithm; interpolationDegree?: number }): void; + addSample(time: JulianDate, value: Packable, derivatives?: Packable[]): void; + addSamples(times: JulianDate[], values: Packable[], derivativeValues?: any[][]): void; + addSamplesPackedArray(packedSamples: number[], epoch?: JulianDate): void; + } + + class StripeMaterialProperty extends MaterialProperty { + orientation: Property; + evenColor: Color; + oddColor: Color; + offset: Property; + repeat: number; + constructor(options?: { evenColor?: Property; oddColor?: Property; repeat?: Property; offset?: Property; orientation?: Property }); + } + + class TimeIntervalCollectionPositionProperty extends PositionProperty { + intervals: TimeIntervalCollection; + constructor(referenceFrame?: ReferenceFrame); + } + + class TimeIntervalCollectionProperty extends Property { + intervals: TimeIntervalCollection; + } + + class VelocityOrientationProperty extends Property { + position: Property; + ellipsoid: Property; + constructor(position?: Property, ellipsoid?: Ellipsoid); + getValue(time?: JulianDate, result?: Quaternion): Quaternion; + } + + abstract class Visualizer { + update(time: JulianDate): boolean; + isDestroyed(): boolean; + destroy(): void; + } + + class WallGeometryUpdater extends GeometryUpdater { + constructor(entity: Entity, scene: Scene); + } + + class WallGraphics { + readonly definitionChanged: Event; + show: Property; + material: MaterialProperty; + positions: Property; + minimumHeights: Property; + maximumHeights: Property; + granularity: Property; + fill: Property; + outline: Property; + outlineColor: Property; + outlineWidth: Property; + constructor(options?: { + positions?: Property; + maximumHeights?: Property; + minimumHeights?: Property; + show?: Property; + fill?: Property; + material?: MaterialProperty; + outline?: Property; + outlineColor?: Property; + outlineWidth?: Property; + granularity?: Property + }); + clone(result?: WallGraphics): WallGraphics; + merge(source: WallGraphics): WallGraphics; + } + + class Appearance { + readonly closed: boolean; + readonly fragmentShaderSource: string; + material: Material; + readonly renderState: any; + translucent: boolean; + readonly vertexShaderSource: string; + constructor(options?: { translucent?: boolean; closed?: boolean; material?: Material; vertexShaderSource?: string; fragmentShaderSource?: string; renderState?: RenderState }); + getFragmentShaderSource(): string; + isTranslucent(): boolean; + getRenderState(): any; + } + + class ArcGisMapServerImageryProvider extends ImageryProvider { + url: string; + usingPrecachedTiles: boolean; + constructor(options: { + url: string; + tileDiscardPolicy?: TileDiscardPolicy; + proxy?: Proxy; + usePreCachedTilesIfAvailable?: boolean; + enablePickFeatures?: boolean; + rectangle?: Rectangle; + tilingScheme?: TilingScheme; + ellipsoid?: Ellipsoid; + tileWidth?: number; + tileHeight?: number; + maximumLevel?: number + }, layers?: string); + } + + class DistanceDisplayCondition extends Packable { + far: number; + near: number; + constructor(near: number, far: number); + static clone(value?: DistanceDisplayCondition, result?: DistanceDisplayCondition): DistanceDisplayCondition; + static equals(left: DistanceDisplayCondition, right: DistanceDisplayCondition): boolean; + static pack(value: DistanceDisplayCondition, array: number[], startingIndex: number): number[]; + static unpack(array: number[], startingIndex: number, result: DistanceDisplayCondition): DistanceDisplayCondition; + clone(result: DistanceDisplayCondition): DistanceDisplayCondition; + equals(other: DistanceDisplayCondition): boolean; + } + + class Billboard { + alignedAxis: Cartesian3; + color: Color; + disableDepthTestDistance: number; + distanceDisplayCondition: DistanceDisplayCondition; + eyeOffset: Cartesian3; + height: number; + heightReference: HeightReference; + horizontalOrigin: HorizontalOrigin; + id: any; + image: string; + pixelOffset: Cartesian2; + pixelOffsetScaleByDistance: NearFarScalar; + position: Cartesian3; + readonly ready: boolean; + rotation: number; + scale: number; + scaleByDistance: NearFarScalar; + show: boolean; + sizeInMeters: boolean; + translucencyByDistance: NearFarScalar; + verticalOrigin: VerticalOrigin; + width: number; + computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2; + equals(other: Billboard): boolean; + setImage(id: string, image: HTMLImageElement | HTMLCanvasElement | string | Billboard.CreateImageCallback): void; + setImageSubRegion(id: string, subRegion: BoundingRectangle): void; + } + + namespace Billboard { + type CreateImageCallback = (id: string) => HTMLImageElement | HTMLCanvasElement | Promise; + } + + class BillboardCollection { + blendOption: BlendOption; + debugShowBoundingVolume: boolean; + length: number; + modelMatrix: Matrix4; + constructor(options?: { modelMatrix?: Matrix4; debugShowBoundingVolume?: boolean; scene?: Scene; blendOption?: BlendOption }); + add(billboard?: any): Billboard; + contains(billboard?: Billboard): boolean; + destroy(): void; + get(index: number): Billboard; + isDestroyed(): boolean; + remove(billboard: Billboard): boolean; + removeAll(): void; + update(): void; + } + + class BingMapsImageryProvider extends ImageryProvider { + readonly url: string; + readonly key: string; + readonly mapStyle: BingMapsStyle; + readonly culture: string; + constructor(options: { url: string; key?: string; tileProtocol?: string; mapStyle?: string; culture?: string; ellipsoid?: Ellipsoid; tileDiscardPolicy?: TileDiscardPolicy; proxy?: Proxy }); + static tileXYToQuadKey(x: number, y: number, level: number): string; + static quadKeyToTileXY(quadkey: string): {x: number, y: number, level: number}; + } + + // tslint:disable-next-line no-unnecessary-class + class EasingFunction { + static BACK_IN: EasingFunction.Callback; + static BACK_IN_OUT: EasingFunction.Callback; + static BACK_OUT: EasingFunction.Callback; + static BOUNCE_IN: EasingFunction.Callback; + static BOUNCE_IN_OUT: EasingFunction.Callback; + static BOUNCE_OUT: EasingFunction.Callback; + static CIRCULAR_IN: EasingFunction.Callback; + static CIRCULAR_IN_OUT: EasingFunction.Callback; + static CIRCULAR_OUT: EasingFunction.Callback; + static CUBIC_IN: EasingFunction.Callback; + static CUBIC_IN_OUT: EasingFunction.Callback; + static CUBIR_OUT: EasingFunction.Callback; + static ELASTIC_IN: EasingFunction.Callback; + static ELASTIC_IN_OUT: EasingFunction.Callback; + static ELASTIC_OUT: EasingFunction.Callback; + static EXPONENTIAL_IN: EasingFunction.Callback; + static EXPONENTIAL_IN_OUT: EasingFunction.Callback; + static EXPONENTIAL_OUT: EasingFunction.Callback; + static LINEAR_NONE: EasingFunction.Callback; + static QUADRATIC_IN: EasingFunction.Callback; + static QUADRATIC_IN_OUT: EasingFunction.Callback; + static QUADRATIC_OUT: EasingFunction.Callback; + static QUARTIC_IN: EasingFunction.Callback; + static QUARTIC_IN_OUT: EasingFunction.Callback; + static QUARTIC_OUT: EasingFunction.Callback; + static QUINTIC_IN: EasingFunction.Callback; + static QUINTIC_IN_OUT: EasingFunction.Callback; + static QUINTIC_OUT: EasingFunction.Callback; + static SINUSOIDAL_IN: EasingFunction.Callback; + static SINUSOIDAL_IN_OUT: EasingFunction.Callback; + static SINUSOIDAL_OUT: EasingFunction.Callback; + } + + namespace EasingFunction { + type Callback = (time: number) => number; + } + + class Camera { + position: Cartesian3; + direction: Cartesian3; + up: Cartesian3; + right: Cartesian3; + frustum: Frustum; + defaultMoveAmount: number; + defaultLookAmount: number; + defaultRotateAmount: number; + defaultZoomAmount: number; + constrainedAxis: Cartesian3; + maximumTranslateFactor: number; + maximumZoomFactor: number; + readonly transform: Matrix4; + readonly inverseTransform: Matrix4; + readonly viewMatrix: Matrix4; + readonly inverseViewMatrix: Matrix4; + readonly positionCartographic: Cartographic; + readonly positionWC: Cartesian3; + percentageChanged: number; + readonly directionWC: Cartesian3; + readonly upWC: Cartesian3; + readonly rightWC: Cartesian3; + readonly heading: number; + readonly pitch: number; + readonly roll: number; + readonly moveStart: Event; + readonly moveEnd: Event; + static DEFAULT_OFFSET: HeadingPitchRange; + static DEFAULT_VIEW_RECTANGLE: Rectangle; + static DEFAULT_VIEW_FACTOR: number; + readonly changed: Event; + constructor(scene: Scene); + cameraToWorldCoordinates(cartesian: Cartesian4, result?: Cartesian4): Cartesian4; + cameraToWorldCoordinatesPoint(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + cameraToWorldCoordinatesVector(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + cancelFlight(): void; + computeViewRectangle(ellipsoid?: Ellipsoid, result?: Rectangle): Rectangle | undefined; + distanceToBoundingSphere(boundingSphere: BoundingSphere): number; + flyHome(duration: number): void; + flyTo(options: { + destination: Cartesian3 | Rectangle; + orientation?: any; + duration?: number; + complete?: Camera.FlightCompleteCallback; + cancel?: Camera.FlightCancelledCallback; + endTransform?: Matrix4; + maximumHeight?: number; + pitchAdjustHeight?: number; + flyOverLongitude?: number; + flyOverLongitudeWeight?: number; + easingFunction?: EasingFunction + }): void; + flyToBoundingSphere(boundingSphere: BoundingSphere, options?: { + duration?: number; + offset?: HeadingPitchRange; + complete?: Camera.FlightCompleteCallback; + cancel?: Camera.FlightCancelledCallback; + endTransform?: Matrix4; + maximumHeight?: number; + pitchAdjustHeight?: number; + flyOverLongitude?: number; + flyOverLongitudeWeight?: number; + easingFunction?: EasingFunction + }): void; + getMagnitude(): number; + getPickRay(windowPosition: Cartesian2, result?: Ray): Ray; + getPixelSize(boundingSphere: BoundingSphere, drawingBufferWidth: number, drawingBufferHeight: number): number; + getRectangleCameraCoordinates(rectangle: Rectangle, result?: Cartesian3): Cartesian3; + look(axis: Cartesian3, angle?: number): void; + lookAt(target: Cartesian3, offset: Cartesian3 | HeadingPitchRange): void; + lookAtTransform(transform: Matrix4, offset: Cartesian3 | HeadingPitchRange): void; + lookDown(amount?: number): void; + lookLeft(amount?: number): void; + lookRight(amount?: number): void; + lookUp(amount?: number): void; + move(direction: Cartesian3, amount?: number): void; + moveBackward(amount?: number): void; + moveDown(amount?: number): void; + moveForward(amount?: number): void; + moveLeft(amount?: number): void; + moveRight(amount?: number): void; + moveUp(amount?: number): void; + pickEllipsoid(windowPosition: Cartesian2, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3; + rotate(axis: Cartesian3, angle?: number): void; + rotateDown(angle?: number): void; + rotateLeft(angle?: number): void; + rotateRight(angle?: number): void; + rotateUp(angle?: number): void; + setView(options: {destination?: Cartesian3 | Rectangle; orientation?: any; endTransform?: Matrix4}): void; + switchToOrthographicFrustum(): void; + switchToPerspectiveFrustum(): void; + twistLeft(amount?: number): void; + twistRight(amount?: number): void; + viewBoundingSphere(boundingSphere: BoundingSphere, offset?: HeadingPitchRange): void; + worldToCameraCoordinates(cartesian: Cartesian4, result?: Cartesian4): Cartesian4; + worldToCameraCoordinatesPoint(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + worldToCameraCoordinatesVector(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + zoomIn(amount?: number): void; + zoomOut(amount?: number): void; + } + + namespace Camera { + type FlightCancelledCallback = () => void; + type FlightCompleteCallback = () => void; + } + + class CameraEventAggregator { + currentMousePosition: Cartesian2; + anyButtonDown: boolean; + constructor(element?: HTMLCanvasElement); + isMoving(type: CameraEventType, modifier?: KeyboardEventModifier): boolean; + getMovement(type: CameraEventType, modifier?: KeyboardEventModifier): any; + getLastMovement(type: CameraEventType, modifier?: KeyboardEventModifier): any; + isButtonDown(type: CameraEventType, modifier?: KeyboardEventModifier): boolean; + getStartMousePosition(type: CameraEventType, modifier?: KeyboardEventModifier): Cartesian2; + getButtonPressTime(type: CameraEventType, modifier?: KeyboardEventModifier): Date; + getButtonReleaseTime(type: CameraEventType, modifier?: KeyboardEventModifier): Date; + reset(): void; + isDestroyed(): boolean; + destroy(): void; + } + + class CreditDisplay { + static cesiumCredit: Credit; + container: HTMLElement; + constructor(container: HTMLElement, delimiter?: string, viewport?: HTMLElement); + addCredit(credit: Credit): void; + addDefaultCredit(credit: Credit): void; + beginFrame(credit: Credit): void; + destroy(): void; + endFrame(credit: Credit): void; + isDestroyed(): boolean; + removeDefaultCredit(credit: Credit): void; + update(): void; + } + + class CullingVolume { + planes: Cartesian4[]; + constructor(planes: Cartesian4[]); + computeVisibility(boundingVolume: any): Intersect; + } + + class DebugAppearance extends Appearance { + readonly attributeName: string; + readonly glslDatatype: string; + constructor(options: { attributeName: string; glslDatatype?: string; vertexShaderSource?: string; fragmentShaderSource?: string; renderState?: RenderState }); + } + + class DebugModelMatrixPrimitive { + length: number; + width: number; + show: boolean; + modelMatrix: Matrix4; + id: any; + constructor(options?: { length?: number; width?: number; modelMatrix?: Matrix4; show?: boolean; id?: any }); + isDestroyed(): boolean; + destroy(): void; + } + + class DiscardMissingTileImagePolicy { + constructor(options: { missingImageUrl: Resource | string; pixelsToCheck: Cartesian2[]; disableCheckIfAllPixelsAreTransparent?: boolean }); + isReady(): boolean; + shouldDiscardImage(image: HTMLImageElement): boolean; + } + + class EllipsoidPrimitive { + center: Cartesian3; + radii: Cartesian3; + modelMatrix: Matrix4; + show: boolean; + material: Material; + id: any; + debugShowBoundingVolume: boolean; + constructor(options?: { center?: Cartesian3; radii?: Cartesian3; modelMatrix?: Matrix4; show?: boolean; material?: Material; id?: any; debugShowBoundingVolume?: boolean }); + update(): void; + isDestroyed(): boolean; + destroy(): void; + } + + class EllipsoidSurfaceAppearance extends Appearance { + readonly vertexFormat: VertexFormat; + readonly flat: boolean; + readonly faceForward: boolean; + readonly aboveGround: boolean; + static VERTEX_FORMAT: VertexFormat; + constructor(options?: { + flat?: boolean; + faceForward?: boolean; + translucent?: boolean; + aboveGround?: boolean; + material?: Material; + vertexShaderSource?: string; + fragmentShaderSource?: string; + renderState?: RenderState + }); + } + + class FrameRateMonitor { + samplingWindow: number; + quietPeriod: number; + warmupPeriod: number; + minimumFrameRateDuringWarmup: number; + minimumFrameRateAfterWarmup: number; + scene: Scene; + lowFrameRate: Event; + nominalFrameRate: Event; + lastFramesPerSecond: number; + static defaultSettings: any; + constructor(options?: { + scene: Scene; + samplingWindow?: number; + quietPeriod?: number; + warmupPeriod?: number; + minimumFrameRateDuringWarmup?: number; + minimumFrameRateAfterWarmup?: number + }); + pause(): void; + unpause(): void; + isDestroyed(): boolean; + destroy(): void; + static fromScene(scene: Scene): FrameRateMonitor; + } + + // tslint:disable-next-line no-unnecessary-class + class GetFeatureInfoFormat { + constructor(type: string, format?: string, callback?: (res: any) => any); + } + + class Globe { + terrainProvider: TerrainProvider; + northPoleColor: Cartesian3; + southPoleColor: Cartesian3; + show: boolean; + oceanNormalMapUrl: string; + depthTestAgainstTerrain: boolean; + maximumScreenSpaceError: number; + tileCacheSize: number; + enableLighting: boolean; + lightingFadeOutDistance: number; + lightingFadeInDistance: number; + showWaterEffect: boolean; + ellipsoid: Ellipsoid; + imageryLayers: ImageryLayerCollection; + baseColor: Color; + constructor(ellipsoid?: Ellipsoid); + pick(ray: Ray, scene: Scene, result?: Cartesian3): Cartesian3; + getHeight(cartographic: Cartographic): number; + isDestroyed(): boolean; + destroy(): void; + } + + class GoogleEarthEnterpriseImageryProvider extends ImageryProvider { + url: string; + path: string; + channel: number; + version: number; + requestType: string; + constructor(options: { + url: string; + channel: number; + path?: string; + maximumLevel?: number; + tileDiscardPolicy?: TileDiscardPolicy; + ellipsoid?: Ellipsoid; + proxy?: Proxy + }); + } + + class GridImageryProvider extends ImageryProvider { + constructor(options?: { + tilingScheme?: TilingScheme; + ellipsoid?: Ellipsoid; + cells?: number; + color?: Color; + glowColor?: Color; + glowWidth?: number; + tileWidth?: number; + tileHeight?: number; + canvasSize?: number + }, backgroundColor?: Color); + } + + class HeadingPitchRange { + heading: number; + pitch: number; + range: number; + constructor(heading?: number, pitch?: number, range?: number); + static clone(hpr: HeadingPitchRange, result?: HeadingPitchRange): HeadingPitchRange; + } + + class ImageryLayer { + alpha: number; + brightness: number; + contrast: number; + hue: number; + saturation: number; + gamma: number; + show: boolean; + imageryProvider: ImageryProvider; + rectangle: Rectangle; + static DEFAULT_BRIGHTNESS: number; + static DEFAULT_CONTRAST: number; + static DEFAULT_HUE: number; + static DEFAULT_SATURATION: number; + static DEFAULT_GAMMA: number; + constructor(imageryProvider: ImageryProvider, options?: { + rectangle?: Rectangle; + alpha?: number | ImageryLayer.ValueFunc; + brightness?: number | ImageryLayer.ValueFunc; + contrast?: number | ImageryLayer.ValueFunc; + hue?: number | ImageryLayer.ValueFunc; + saturation?: number | ImageryLayer.ValueFunc; + gamma?: number | ImageryLayer.ValueFunc; + show?: boolean; + maximumAnisotropy?: number; + minimumTerrainLevel?: number; + maximumTerrainLevel?: number + }); + isBaseLayer(): boolean; + isDestroyed(): boolean; + destroy(): void; + } + + namespace ImageryLayer { + type ValueFunc = (frameState: any, layer: ImageryLayer, x: number, y: number, level: number) => number; + } + + class ImageryLayerCollection { + layerAdded: Event; + layerRemoved: Event; + layerMoved: Event; + layerShownOrHidden: Event; + length: number; + add(layer: ImageryLayer, index?: number): void; + addImageryProvider(imageryProvider: ImageryProvider, index?: number): ImageryLayer; + remove(layer: ImageryLayer, destroy?: boolean): boolean; + removeAll(destroy?: boolean): void; + contains(layer: ImageryLayer): boolean; + indexOf(layer: ImageryLayer): number; + get(index: number): ImageryLayer; + raise(layer: ImageryLayer): void; + lower(layer: ImageryLayer): void; + raiseToTop(layer: ImageryLayer): void; + lowerToBottom(layer: ImageryLayer): void; + pickImageryLayerFeatures(ray: Ray, scene: Scene): Promise | undefined; + isDestroyed(): boolean; + destroy(): void; + } + + class ImageryLayerFeatureInfo { + name: string; + description: string; + position: Cartographic; + data: any; + configureNameFromProperties(properties: any): void; + configureDescriptionFromProperties(properties: any): void; + } + + abstract class ImageryProvider { + credit: Credit; + defaultAlpha: number; + defaultBrightness: number; + defaultContrast: number; + defaultGamma: number; + defaultHue: number; + defaultSaturation: number; + defaultMagnificationFilter: any; + defaultMinificationFilter: any; + readonly errorEvent: Event; + readonly hasAlphaChannel: boolean; + readonly maximumLevel: number; + readonly minimumLevel: number; + readonly proxy: Proxy; + readonly ready: boolean; + readonly readyPromise: Promise; + readonly rectangle: Rectangle; + readonly tileDiscardPolicy: TileDiscardPolicy; + readonly tileWidth: number; + readonly tileHeight: number; + readonly tilingScheme: TilingScheme; + getTileCredits(x: number, y: number, level: number): Credit[]; + requestImage(x: number, y: number, level: number): Promise; + pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise; + static loadImage(url: string): Promise; + } + + class Label { + show: boolean; + position: Cartesian3; + text: string; + font: string; + fillColor: Color; + outlineColor: Color; + outlineWidth: number; + style: LabelStyle; + pixelOffset: Cartesian2; + translucencyByDistance: NearFarScalar; + pixelOffsetScaleByDistance: NearFarScalar; + eyeOffset: Cartesian3; + horizontalOrigin: HorizontalOrigin; + verticalOrigin: VerticalOrigin; + scale: number; + id: any; + computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2; + equals(other: Label): boolean; + isDestroyed(): boolean; + } + + class LabelCollection { + modelMatrix: Matrix4; + debugShowBoundingVolume: boolean; + length: number; + constructor(options?: { modelMatrix?: Matrix4; debugShowBoundingVolume?: boolean }); + add(options?: any): Label; + remove(label: Label): boolean; + removeAll(): void; + contains(label: Label): boolean; + get(index: number): Label; + isDestroyed(): boolean; + destroy(): void; + } + + class Material { + type: string; + shaderSource: string; + materials: any; + uniforms: any; + translucent: boolean; + static DefaultImageId: string; + static DefaultCubeMapId: string; + static ColorType: string; + static ImageType: string; + static DiffuseMapType: string; + static AlphaMapType: string; + static SpecularMapType: string; + static EmissionMapType: string; + static BumpMapType: string; + static NormalMapType: string; + static GridType: string; + static StripeType: string; + static CheckerboardType: string; + static DotType: string; + static WaterType: string; + static RimLightingType: string; + static FadeType: string; + static PolylineArrowType: string; + static PolylineGlowType: string; + static PolylineOutlineType: string; + constructor(options?: { strict?: boolean; translucent?: boolean; fabric: any }); + isTranslucent(): boolean; + isDestroyed(): boolean; + destroy(): void; + static fromType(type: string, uniforms?: any): Material; + } + + class MaterialAppearance extends Appearance { + readonly materialSupport: MaterialAppearance.MaterialSupport; + readonly vertexFormat: VertexFormat; + readonly flat: boolean; + readonly faceForward: boolean; + constructor(options?: { + flat?: boolean; + faceForward?: boolean; + translucent?: boolean; + closed?: boolean; + materialSupport?: MaterialAppearance.MaterialSupport; + material?: Material; + vertexShaderSource?: string; + fragmentShaderSource?: string; + renderState?: RenderState + }); + } + + namespace MaterialAppearance { + enum MaterialSupport { + BASIC, + TEXTURED, + ALL + } + } + + class Model { + show: boolean; + modelMatrix: Matrix4; + scale: number; + minimumPixelSize: number; + id: any; + activeAnimations: ModelAnimationCollection; + debugShowBoundingVolume: boolean; + debugWireframe: boolean; + gltf: any; + basePath: string; + boundingSphere: BoundingSphere; + ready: boolean; + readyPromise: Promise; + asynchronous: boolean; + allowPicking: boolean; + constructor(options?: { + gltf?: any; + basePath?: string; + show?: boolean; + modelMatrix?: Matrix4; + scale?: number; + minimumPixelSize?: number; + id?: any; + allowPicking?: boolean; + asynchronous?: boolean; + debugShowBoundingVolume?: boolean; + debugWireframe?: boolean + }); + getNode(name: string): ModelNode; + getMesh(name: string): ModelMesh; + getMaterial(name: string): ModelMaterial; + update(): void; + isDestroyed(): boolean; + destroy(): void; + static fromGltf(options: { + url: string; + headers?: any; + show?: boolean; + modelMatrix?: Matrix4; + scale?: number; + minimumPixelSize?: number; + allowPicking?: boolean; + asynchronous?: boolean; + debugShowBoundingVolume?: boolean; + debugWireframe?: boolean + }): Model; + } + + class ModelAnimation { + removeOnStop: boolean; + start: Event; + update: Event; + stop: Event; + name: string; + startTime: JulianDate; + delay: number; + stopTime: JulianDate; + speedup: number; + reverse: boolean; + loop: ModelAnimationLoop; + } + + class ModelAnimationCollection { + animationAdded: Event; + animationRemoved: Event; + length: number; + add(options: { + name: string; + startTime?: JulianDate; + delay?: number; + stopTime?: JulianDate; + removeOnStop?: boolean; + speedup?: number; + reverse?: boolean; + loop?: ModelAnimationLoop + }): ModelAnimation; + addAll(options?: { + startTime?: JulianDate; + delay?: number; + stopTime?: JulianDate; + removeOnStop?: boolean; + speedup?: number; + reverse?: boolean; + loop?: ModelAnimationLoop + }): ModelAnimation[]; + remove(animation: ModelAnimation): boolean; + removeAll(): void; + contains(animation: ModelAnimation): boolean; + get(index: number): ModelAnimation; + } + + class ModelMaterial { + readonly name: string; + readonly id: string; + setValue(name: string, value?: any): void; + getValue(name: string): any; + } + + class ModelMesh { + name: string; + id: string; + materials: ModelMaterial[]; + } + + class ModelNode { + name: string; + id: string; + show: boolean; + matrix: Matrix4; + } + + class Moon { + show: boolean; + textureUrl: string; + onlySunLighting: boolean; + ellipsoid: Ellipsoid; + constructor(options?: { show?: boolean; textureUrl?: string; ellipsoid?: Ellipsoid; onlySunLighting?: boolean }); + isDestroyed(): boolean; + destroy(): void; + } + + class NeverTileDiscardPolicy { + isReady(): boolean; + shouldDiscardImage(image: HTMLImageElement | Promise): Promise; + } + + class PerInstanceColorAppearance extends Appearance { + readonly vertexFormat: VertexFormat; + readonly flat: boolean; + readonly faceForward: boolean; + static VERTEX_FORMAT: VertexFormat; + static FLAT_VERTEX_FORMAT: VertexFormat; + constructor(options?: { flat?: boolean; + faceForward?: boolean; + translucent?: boolean; + closed?: boolean; + vertexShaderSource?: string; + fragmentShaderSource?: string; + renderState?: RenderState + }); + } + + abstract class Frustum { + near: number; + far: number; + readonly projectionMatrix: Matrix4; + computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume; + getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, result: Cartesian2): Cartesian2; + } + + class OrthographicFrustum extends Frustum { + aspectRatio: number; + width: number; + static packedLength: number; + constructor(options?: {width: number; aspectRatio: number; near: number; far: number}); + pack(value: OrthographicFrustum, array: number[], startingIndex: number): number[]; + unpack(array: number[], startingIndex: number, result: OrthographicFrustum): OrthographicFrustum; + clone(result?: OrthographicFrustum): OrthographicFrustum; + equals(other?: OrthographicFrustum): boolean; + } + + class PerspectiveFrustum extends Frustum { + fov: number; + aspectRatio: number; + xOffset: number; + yOffset: number; + readonly infiniteProjectionMatrix: Matrix4; + readonly fovy: number; + static packedLength: number; + constructor(options?: {fov: number; aspectRatio: number; near: number; far: number; xOffset: number; yOffset: number}); + pack(value: PerspectiveFrustum, array: number[], startingIndex: number): number[]; + unpack(array: number[], startingIndex: number, result: PerspectiveFrustum): PerspectiveFrustum; + clone(result?: PerspectiveFrustum): PerspectiveFrustum; + equals(other?: PerspectiveFrustum): boolean; + } + + class PerspectiveOffCenterFrustum extends Frustum { + left: number; + right: number; + top: number; + bottom: number; + readonly infiniteProjectionMatrix: Matrix4; + constructor(options?: {left: number; right: number; top: number; bottom: number; near: number; far: number}); + clone(result?: PerspectiveOffCenterFrustum): PerspectiveOffCenterFrustum; + equals(other?: PerspectiveOffCenterFrustum): boolean; + } + + class PointPrimitive { + color: Color; + disableDepthTestDistance: number; + distanceDisplayCondition: DistanceDisplayCondition; + id: any; + outlineColor: Color; + outlineWidth: number; + pixelSize: number; + position: Cartesian3; + scaleByDistance: NearFarScalar; + show: boolean; + translucencyByDistance: NearFarScalar; + computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2; + equals(other: PointPrimitive): boolean; + } + + class PointPrimitiveCollection { + blendOption: BlendOption; + debugShowBoundingVolume: boolean; + length: number; + modelMatrix: Matrix4; + constructor(options?: { modelMatrix?: Matrix4; debugShowBoundingVolume?: boolean, blendOption?: BlendOption }); + add(pointPrimitive?: any): PointPrimitive; + contains(pointPrimitive?: PointPrimitive): boolean; + destroy(): void; + get(index: number): PointPrimitive; + isDestroyed(): boolean; + remove(pointPrimitive: PointPrimitive): boolean; + removeAll(): void; + } + + class Polyline { + show: boolean; + positions: Cartesian3[]; + material: Material; + width: number; + loop: boolean; + id: any; + constructor(options?: { show?: boolean; width?: number; loop?: boolean; material?: Material; positions?: Cartesian3[]; id?: any }); + } + + class PolylineCollection { + modelMatrix: Matrix4; + debugShowBoundingVolume: boolean; + length: number; + constructor(options?: { modelMatrix?: Matrix4; debugShowBoundingVolume?: boolean }); + add(polyline?: any): Polyline; + remove(polyline: Polyline): boolean; + removeAll(): void; + contains(polyline: Polyline): boolean; + get(index: number): Polyline; + isDestroyed(): boolean; + destroy(): void; + } + + class PolylineColorAppearance extends Appearance { + readonly vertexFormat: VertexFormat; + static VERTEX_FORMAT: VertexFormat; + constructor(options?: { translucent?: boolean; vertexShaderSource?: string; fragmentShaderSource?: string; renderState?: RenderState }); + } + + class PolylineMaterialAppearance extends Appearance { + readonly vertexFormat: VertexFormat; + static VERTEX_FORMAT: VertexFormat; + constructor(options?: { translucent?: boolean; material?: Material; vertexShaderSource?: string; fragmentShaderSource?: string; renderState?: RenderState }); + } + + class Primitive { + readonly allowPicking: boolean; + appearance: Appearance; + readonly asynchronous: boolean; + readonly compressVertices: boolean; + cull: boolean; + debugShowBoundingVolume: boolean; + depthFailAppearance: Appearance; + readonly geometryInstances: GeometryInstance[] | GeometryInstance; + readonly interleave: boolean; + modelMatrix: Matrix4; + readonly ready: boolean; + readonly readyPromise: Promise; + readonly releaseGeometryInstances: boolean; + shadows: ShadowMode; + show: boolean; + readonly vertexCacheOptimize: boolean; + constructor(options?: { + geometryInstances?: any[] | GeometryInstance; + appearance?: Appearance; + show?: boolean; + modelMatrix?: Matrix4; + vertexCacheOptimize?: boolean; + interleave?: boolean; + compressVertices?: boolean; + releaseGeometryInstances?: boolean; + allowPicking?: boolean; + cull?: boolean; + asynchronous?: boolean; + debugShowBoundingVolume?: boolean; + shadows: ShadowMode + }); + destroy(): void; + getGeometryInstanceAttributes(id: any): any; + isDestroyed(): boolean; + update(): void; + } + + class PrimitiveCollection { + show: boolean; + destroyPrimitives: boolean; + readonly length: number; + constructor(options?: { show?: boolean; destroyPrimitives?: boolean }); + add(primitive: any): any; + remove(primitive?: any): boolean; + removeAll(): void; + contains(primitive?: any): boolean; + raise(primitive?: any): void; + raiseToTop(primitive?: any): void; + lower(primitive?: any): void; + lowerToBottom(primitive?: any): void; + get(index: number): any; + isDestroyed(): boolean; + destroy(): void; + } + + class RectanglePrimitive { + ellipsoid: Ellipsoid; + rectangle: Rectangle; + granularity: number; + height: number; + rotation: number; + textureRotationAngle: number; + show: boolean; + material: Material; + id: any; + asynchronous: boolean; + debugShowBoundingVolume: boolean; + constructor(options?: { + ellipsoid?: Ellipsoid; + rectangle?: Rectangle; + granularity?: number; + height?: number; + rotation?: number; + textureRotationAngle?: number; + show?: boolean; + material?: Material; + id?: any; + asynchronous?: boolean; + debugShowBoundingVolume?: boolean + }); + update(): void; + isDestroyed(): boolean; + destroy(): void; + } + + class Scene { + backgroundColor: Color; + readonly camera: Camera; + readonly canvas: Element; + completeMorphOnUserInput: boolean; + debugCommandFilter: (command: any) => boolean; + readonly debugFrustumStatistics: any; + debugShowCommands: boolean; + debugShowDepthFrustum: number; + debugShowFramesPerSecond: boolean; + debugShowFrustumPlanes: boolean; + debugShowFrustums: boolean; + readonly drawingBufferHeight: number; + readonly drawingBufferWidth: number; + eyeSeparation: number; + farToNearRatio: number; + focalLength: number; + fog: Fog; + fxaa: boolean; + globe: Globe; + readonly groundPrimitives: PrimitiveCollection; + readonly id: string; + readonly imageryLayers: ImageryLayerCollection; + imagerySplitPosition: number; + invertClassification: boolean; + invertClassificationColor: Color; + readonly lastRenderTime: JulianDate; + logarithmicDepthFarToNearRatio: number; + mapMode2D: boolean; + readonly mapProjection: MapProjection; + readonly maximumAliasedLineWidth: number; + readonly maximumCubeMapSize: number; + maximumRenderTimeChange: number; + minimumDisableDepthTestDistance: number; + mode: SceneMode; + moon: Moon; + morphComplete: Event; + morphStart: Event; + morphTime: number; + nearToFarDistance2D: number; + readonly orderIndependentTranslucency: boolean; + readonly pickPositionSupported: boolean; + pickTranslucentDepth: boolean; + readonly postRender: Event; + readonly preRender: Event; + readonly preUpdate: Event; + readonly primitives: PrimitiveCollection; + readonly renderError: Event; + requestRenderMode: boolean; + rethrowRenderErrors: boolean; + readonly scene3DOnly: boolean; + readonly screenSpaceCameraController: ScreenSpaceCameraController; + shadowMap: ShadowMap; + skyAtmosphere: SkyAtmosphere; + skyBox: SkyBox; + sun: Sun; + sunBloom: boolean; + terrainExaggeration: number; + terrainProvider: TerrainProvider; + readonly terrainProviderChanged: Event; + useDepthPicking: boolean; + useWebVR: boolean; + constructor(options?: { + canvas: HTMLCanvasElement; + contextOptions?: any; + creditContainer?: Element; + creditViewport?: Element; + mapProjection?: MapProjection; + orderIndependentTranslucency?: boolean; + scene3DOnly?: boolean; + terrainExaggeration?: number; + shadows?: boolean; + mapMode2D?: MapMode2D; + requestRenderMode?: boolean; + maximumRenderTimeChange?: number + }); + cartesianToCanvasCoordinates(position: Cartesian3, result?: Cartesian2): Cartesian2; + completeMorph(): void; + destroy(): void; + drillPick(windowPosition: Cartesian2, limit?: number): any[]; + getCompressedTextureFormatSupported(format: string): boolean; + isDestroyed(): boolean; + morphTo2D(duration?: number): void; + morphTo3D(duration?: number): void; + morphToColumbusView(duration?: number): void; + pick(windowPosition: Cartesian2, width?: number, height?: number): any; + pickPosition(windowPosition: Cartesian2, result?: Cartesian3): Cartesian3; + requestRender(): void; + } + + class ScreenSpaceCameraController { + enableInputs: boolean; + enableTranslate: boolean; + enableZoom: boolean; + enableRotate: boolean; + enableTilt: boolean; + enableLook: boolean; + inertiaSpin: number; + inertiaTranslate: number; + inertiaZoom: number; + maximumMovementRatio: number; + bounceAnimationTime: number; + minimumZoomDistance: number; + maximumZoomDistance: number; + translateEventTypes: CameraEventType | any[]; + zoomEventTypes: CameraEventType | any[]; + rotateEventTypes: CameraEventType | any[]; + tiltEventTypes: CameraEventType | any[]; + lookEventTypes: CameraEventType | any[]; + minimumPickingTerrainHeight: number; + minimumCollisionTerrainHeight: number; + minimumTrackBallHeight: number; + enableCollisionDetection: boolean; + constructor(scene: Scene); + isDestroyed(): boolean; + destroy(): void; + } + + class SingleTileImageryProvider extends ImageryProvider { + url: string; + constructor(options: { url: string; rectangle?: Rectangle; credit?: Credit | string; ellipsoid?: Ellipsoid; proxy?: any }); + } + + class SkyAtmosphere { + show: boolean; + ellipsoid: Ellipsoid; + constructor(ellipsoid?: Ellipsoid); + isDestroyed(): boolean; + destroy(): void; + } + + class SkyBox { + sources: any; + show: boolean; + constructor(options: { sources?: any; show?: boolean }); + update(): void; + isDestroyed(): boolean; + destroy(): void; + } + + class Sun { + show: boolean; + glowFactor: number; + isDestroyed(): boolean; + destroy(): void; + } + + class Fog { + density: number; + enabled: boolean; + minimumBrightness: number; + screenSpaceErrorFactor: number; + } + + class TileCoordinatesImageryProvider extends ImageryProvider { + constructor(options?: { tilingScheme?: TilingScheme; ellipsoid?: Ellipsoid; color?: Color; tileWidth?: number; tileHeight?: number }); + } + + class TileDiscardPolicy { + isReady(): boolean; + shouldDiscardImage(image: HTMLImageElement | Promise): Promise; + } + + class TileMapServiceImageryProvider extends ImageryProvider { + url: string; + constructor(options?: { + url?: string; + fileExtension?: string; + proxy?: any; + credit?: Credit | string; + minimumLevel?: number; + maximumLevel?: number; + rectangle?: Rectangle; + tilingScheme?: TilingScheme; + ellipsoid?: Ellipsoid; + tileWidth?: number; + tileHeight?: number + }); + } + + class ViewportQuad { + show: boolean; + rectangle: BoundingRectangle; + material: Material; + constructor(rectangle?: BoundingRectangle, material?: Material); + update(): void; + isDestroyed(): boolean; + destroy(): void; + } + + class WebMapServiceImageryProvider extends ImageryProvider { + readonly url: string; + static DefaultParameters: {service: string, version: string, request: string, styles: string, format: string}; + static GetFeatureInfoDefaultParameters: {service: string, version: string, request: string}; + constructor(options: { + url: string; + layers: string; + parameters?: any; + getFeatureInfoParameters?: any; + enablePickFeatures?: boolean; + getFeatureInfoFormats?: GetFeatureInfoFormat[]; + rectangle?: Rectangle; + tilingScheme?: TilingScheme; + ellipsoid?: Ellipsoid; + tileWidth?: number; + tileHeight?: number; + minimumLevel?: number; + maximumLevel?: number; + crs?: string; + srs?: string; + credit?: Credit | string; + subdomains?: string | string[] + }); + } + + class WebMapTileServiceImageryProvider extends ImageryProvider { + clock: Clock; + dimensions: any; + readonly format: string; + times: TimeIntervalCollection; + readonly url: string; + constructor(options: { + url: string; + format?: string; + layer: string; + style: string; + tileMatrixSetID: string; + tileMatrixLabels?: any[]; + clock?: Clock; + times?: TimeIntervalCollection; + dimensions?: any; + tileWidth?: number; + tileHeight?: number; + tilingScheme?: TilingScheme; + rectangle?: Rectangle; + minimumLevel?: number; + maximumLevel?: number; + ellipsoid?: Ellipsoid; + credit?: Credit | string; + subdomains?: string | string[] + }); + } + + class Animation { + readonly container: Element; + readonly viewModel: AnimationViewModel; + constructor(container: Element | string, viewModel: AnimationViewModel); + isDestroyed(): boolean; + destroy(): void; + resize(): void; + applyThemeChanges(): void; + } + + class AnimationViewModel { + shuttleRingDragging: boolean; + snapToTicks: boolean; + timeLabel: string; + dateLabel: string; + multiplierLabel: string; + shuttleRingAngle: number; + slower: Command; + faster: Command; + clockViewModel: ClockViewModel; + pauseViewModel: ToggleButtonViewModel; + playReverseViewModel: ToggleButtonViewModel; + playForwardViewModel: ToggleButtonViewModel; + playRealtimeViewModel: ToggleButtonViewModel; + dateFormatter: AnimationViewModel.DateFormatter; + timeFormatter: AnimationViewModel.TimeFormatter; + static defaultDateFormatter: AnimationViewModel.DateFormatter; + static defaultTicks: number[]; + static defaultTimeFormatter: AnimationViewModel.TimeFormatter; + constructor(clockViewModel: ClockViewModel); + getShuttleRingTicks(): number[]; + setShuttleRingTicks(positiveTicks: number[]): void; + } + + namespace AnimationViewModel { + type DateFormatter = (date: JulianDate, viewModel: AnimationViewModel) => string; + type TimeFormatter = (date: JulianDate, viewModel: AnimationViewModel) => string; + } + + class BaseLayerPicker { + container: Element; + viewModel: BaseLayerPickerViewModel; + constructor(container: Element, options: { + globe: Globe; + imageryProviderViewModels?: ProviderViewModel[]; + selectedImageryProviderViewModel?: ProviderViewModel; + terrainProviderViewModels?: ProviderViewModel[]; + selectedTerrainProviderViewModel?: ProviderViewModel + }); + isDestroyed(): boolean; + destroy(): void; + } + + class BaseLayerPickerViewModel { + imageryProviderViewModels: ProviderViewModel[]; + terrainProviderViewModels: ProviderViewModel[]; + dropDownVisible: boolean; + buttonTooltip: string; + buttonImageUrl: string; + selectedImagery: ProviderViewModel; + selectedTerrain: ProviderViewModel; + toggleDropDown: Command; + globe: Globe; + constructor(options: { + globe: Globe; + imageryProviderViewModels?: ProviderViewModel[]; + selectedImageryProviderViewModel?: ProviderViewModel; + terrainProviderViewModels?: ProviderViewModel[]; + selectedTerrainProviderViewModel?: ProviderViewModel + }); + } + + class ProviderViewModel { + name: string; + tooltip: string; + iconUrl: string; + creationCommand: Command; + constructor(options: { name: string; tooltip: string; iconUrl: string; creationFunction: ProviderViewModel.CreationFunction | Command }); + } + + namespace ProviderViewModel { + type CreationFunction = () => ImageryProvider | TerrainProvider | ImageryProvider[] | TerrainProvider[]; + } + + class CesiumInspector { + container: Element; + viewModel: CesiumInspectorViewModel; + constructor(container: Element | string, scene: Scene); + isDestroyed(): boolean; + destroy(): void; + } + + class CesiumInspectorViewModel { + frustums: boolean; + performance: boolean; + shaderCacheText: string; + primitiveBoundingSphere: boolean; + primitiveReferenceFrame: boolean; + filterPrimitive: boolean; + tileBoundingSphere: boolean; + filterTile: boolean; + wireframe: boolean; + suspendUpdates: boolean; + tileCoordinates: boolean; + frustumStatisticText: string; + tileText: string; + hasPickedPrimitive: boolean; + hasPickedTile: boolean; + pickPimitiveActive: boolean; + pickTileActive: boolean; + dropDownVisible: boolean; + generalVisible: boolean; + primitivesVisible: boolean; + terrainVisible: boolean; + generalSwitchText: string; + primitivesSwitchText: string; + terrainSwitchText: string; + scene: Scene; + performanceContainer: Element; + toggleDropDown: Command; + showFrustums: Command; + showPerformance: Command; + showPrimitiveBoundingSphere: Command; + showPrimitiveReferenceFrame: Command; + doFilterPrimitive: Command; + showWireframe: Command; + doSuspendUpdates: Command; + showTileCoordinates: Command; + showTileBoundingSphere: Command; + doFilterTile: Command; + toggleGeneral: Command; + togglePrimitives: Command; + toggleTerrain: Command; + pickPrimitive: Command; + pickTile: Command; + selectParent: Command; + selectNW: Command; + selectNE: Command; + selectSW: Command; + selectSE: Command; + primitive: Command; + tile: Command; + constructor(scene: Scene); + isDestroyed(): boolean; + destroy(): void; + } + + class CesiumWidget { + container: Element; + canvas: HTMLCanvasElement; + creditContainer: Element; + creditViewport: Element; + scene: Scene; + readonly imageryLayers: ImageryLayerCollection; + terrainProvider: TerrainProvider; + readonly camera: Camera; + clock: Clock; + screenSpaceEventHandler: ScreenSpaceEventHandler; + targetFrameRate: number; + useDefaultRenderLoop: boolean; + resolutionScale: number; + constructor(container: Element | string, options?: { + clock?: Clock; + imageryProvider?: ImageryProvider; + terrainProvider?: TerrainProvider; + skyBox?: SkyBox; + skyAtmosphere?: SkyAtmosphere; + sceneMode?: SceneMode; + scene3DOnly?: boolean; + orderIndependentTranslucency?: boolean; + mapProjection?: MapProjection; + globe?: Globe; + useDefaultRenderLoop?: boolean; + targetFrameRate?: number; + showRenderLoopErrors?: boolean; + contextOptions?: any; + creditContainer?: Element | string; + creditViewport?: Element | string; + terrainExaggeration?: number; + shadows?: boolean; + terrainShadows?: ShadowMode; + mapMode2D?: MapMode2D; + requestRenderMode?: boolean; + maximumRenderTimeChange?: number + }); + showErrorPanel(title: string, message: string, error?: string): void; + isDestroyed(): boolean; + destroy(): void; + resize(): void; + render(): void; + } + + class ClockViewModel { + systemTime: JulianDate; + startTime: JulianDate; + stopTime: JulianDate; + currentTime: JulianDate; + multiplier: number; + clockStep: ClockStep; + clockRange: ClockRange; + canAnimate: boolean; + shouldAnimate: boolean; + clock: Clock; + constructor(clock?: Clock); + synchronize(): void; + isDestroyed(): boolean; + destroy(): void; + } + + class Command { + canExecute: boolean; + beforeExecute: Event; + afterExecute: Event; + } + + class FullscreenButton { + container: Element; + viewModel: FullscreenButtonViewModel; + constructor(container: Element | string, fullscreenElement?: Element | string); + isDestroyed(): boolean; + destroy(): void; + } + + class FullscreenButtonViewModel { + isFullscreen: boolean; + isFullscreenEnabled: boolean; + tooltip: string; + fullscreenElement: Element; + command: Command; + constructor(fullscreenElement?: Element | string); + isDestroyed(): boolean; + destroy(): void; + } + + class Geocoder { + container: Element; + viewModel: GeocoderViewModel; + constructor(options: { container: Element | string; scene: Scene; url?: string; key?: string; flightDuration?: number }); + isDestroyed(): boolean; + destroy(): void; + } + + class GeocoderViewModel { + isSearchInProgress: boolean; + searchText: string; + flightDuration: number; + url: string; + key: string; + complete: Event; + scene: Scene; + search: Command; + constructor(options: { scene: Scene; url?: string; key?: string; flightDuration?: number }); + } + + class HomeButton { + container: Element; + viewModel: HomeButtonViewModel; + constructor(container: Element | string, scene: Scene, duration?: number); + isDestroyed(): boolean; + destroy(): void; + } + + class HomeButtonViewModel { + tooltip: string; + scene: Scene; + command: Command; + duration: number; + constructor(scene: Scene, duration?: number); + } + + class VRButton { + container: Element; + viewModel: VRButtonViewModel; + constructor(container: Element | string, scene: Scene, vrElement: Element | string); + destroy(): void; + isDestroyed(): boolean; + } + + class VRButtonViewModel { + command: Command; + isVREnabled: boolean; + isVRMode: boolean; + tooltip: string; + vrElement: Element; + constructor(scene: Scene, vrElement: Element | string); + destroy(): void; + isDestroyed(): boolean; + } + + class InfoBox { + container: Element; + viewModel: InfoBoxViewModel; + frame: HTMLIFrameElement; + constructor(container: Element | string); + isDestroyed(): boolean; + destroy(): void; + } + + class InfoBoxViewModel { + maxHeight: number; + enableCamera: boolean; + isCameraTracking: boolean; + showInfo: boolean; + titleText: string; + description: string; + cameraIconPath: string; + cameraClicked: Event; + closeClicked: Event; + maxHeightOffset(offset: number): string; + } + + class NavigationHelpButton { + container: Element; + viewModel: NavigationHelpButtonViewModel; + constructor(options: { container: Element | string; instructionsInitiallyVisible?: boolean }); + isDestroyed(): boolean; + destroy(): void; + } + + class NavigationHelpButtonViewModel { + showInstructions: boolean; + tooltip: string; + command: Command; + showClick: Command; + showTouch: Command; + } + + class PerformanceWatchdog { + container: Element; + viewModel: PerformanceWatchdogViewModel; + constructor(options?: { container: Element | string; scene: Scene; lowFrameRateMessage?: string }); + isDestroyed(): boolean; + destroy(): void; + } + + class PerformanceWatchdogViewModel { + lowFrameRateMessage: string; + lowFrameRateMessageDismissed: boolean; + showingLowFrameRateMessage: boolean; + scene: Scene; + dismissMessage: Command; + constructor(options?: { scene: Scene; lowFrameRateMessage?: string }); + } + + class ProjectionPicker { + container: Element; + viewModel: ProjectionPickerViewModel; + constructor(container: Element | string, scene: Scene); + destroy(): void; + isDestroyed(): boolean; + } + + class ProjectionPickerViewModel { + dropDownVisible: boolean; + isOrthographicProjection: Command; + scene: Scene; + sceneMode: SceneMode; + selectedTooltip: string; + switchToOrthographic: Command; + switchToPerspective: Command; + toggleDropdown: Command; + tooltipOrthographic: string; + tooltipPerspective: string; + constructor(scene: Scene); + destroy(): void; + isDestroyed(): boolean; + } + + class SceneModePicker { + container: Element; + viewModel: SceneModePickerViewModel; + constructor(container: Element | string, scene: Scene, duration?: number); + isDestroyed(): boolean; + destroy(): void; + } + + class SceneModePickerViewModel { + sceneMode: SceneMode; + dropDownVisible: boolean; + tooltip2D: string; + tooltip3D: string; + tooltipColumbusView: string; + selectedTooltip: string; + scene: Scene; + duration: number; + toggleDropDown: Command; + morphTo2D: Command; + morphTo3D: Command; + morphToColumbusView: Command; + constructor(scene: Scene, duration?: number); + isDestroyed(): boolean; + destroy(): void; + } + + class SelectionIndicator { + container: Element; + viewModel: SelectionIndicatorViewModel; + constructor(container: Element | string, scene: Scene); + isDestroyed(): boolean; + destroy(): void; + } + + class SelectionIndicatorViewModel { + position: Cartesian3; + showSelection: boolean; + isVisible: boolean; + computeScreenSpacePosition: SelectionIndicatorViewModel.ComputeScreenSpacePosition; + container: Element; + selectionIndicatorElement: Element; + scene: Scene; + constructor(scene: Scene, selectionIndicatorElement: Element, container: Element); + update(): void; + animateAppear(): void; + animateDepart(): void; + } + + namespace SelectionIndicatorViewModel { + type ComputeScreenSpacePosition = (position: Cartesian3, result: Cartesian2) => Cartesian2; + } + + class Timeline { + container: Element; + constructor(container: Element, clock: Clock); + isDestroyed(): boolean; + destroy(): void; + zoomTo(startTime: JulianDate, stopTime: JulianDate): void; + resize(): void; + } + + class ToggleButtonViewModel { + toggled: boolean; + tooltip: string; + command: Command; + constructor(command: Command, options?: { toggled?: boolean; tooltip?: string }); + } + + class Viewer { + readonly container: Element; + readonly bottomContainer: Element; + readonly cesiumWidget: CesiumWidget; + readonly selectionIndicator: SelectionIndicator; + readonly infoBox: InfoBox; + readonly geocoder: Geocoder; + readonly homeButton: HomeButton; + readonly sceneModePicker: SceneModePicker; + readonly projectionPicker: ProjectionPicker; + readonly navigationHelpButton: NavigationHelpButton; + readonly baseLayerPicker: BaseLayerPicker; + readonly animation: Animation; + readonly timeline: Timeline; + readonly fullscreenButton: FullscreenButton; + readonly dataSourceDisplay: DataSourceDisplay; + readonly entities: EntityCollection; + readonly dataSources: DataSourceCollection; + readonly canvas: HTMLCanvasElement; + readonly scene: Scene; + readonly imageryLayers: ImageryLayerCollection; + terrainProvider: TerrainProvider; + terrainShadows: ShadowMode; + readonly camera: Camera; + clockTrackedDataSource: DataSource; + readonly clockViewModel: ClockViewModel; + readonly clock: Clock; + readonly screenSpaceEventHandler: ScreenSpaceEventHandler; + targetFrameRate: number; + useDefaultRenderLoop: boolean; + resolutionScale: number; + allowDataSourcesToSuspendAnimation: boolean; + trackedEntity: Entity; + selectedEntity: Entity; + readonly trackedEntityChanged: Event; + readonly selectedEntityChanged: Event; + readonly shadowMap: ShadowMap; + readonly vrButton: VRButton; + shadows: boolean; + constructor(container: Element | string, options?: { + animation?: boolean; + baseLayerPicker?: boolean; + fullscreenButton?: boolean; + vrButton?: boolean; + geocoder?: boolean; + homeButton?: boolean; + infoBox?: boolean; + sceneModePicker?: boolean; + selectionIndicator?: boolean; + timeline?: boolean; + navigationHelpButton?: boolean; + navigationInstructionsInitiallyVisible?: boolean; + scene3DOnly?: boolean; + shouldAnimate?: boolean; + clockViewModel?: ClockViewModel; + selectedImageryProviderViewModel?: ProviderViewModel; + imageryProviderViewModels?: ProviderViewModel[]; + selectedTerrainProviderViewModel?: ProviderViewModel; + terrainProviderViewModels?: ProviderViewModel[]; + imageryProvider?: ImageryProvider; + terrainProvider?: TerrainProvider; + skyBox?: SkyBox; + skyAtmosphere?: SkyAtmosphere; + fullscreenElement?: Element | string; + useDefaultRenderLoop?: boolean; + targetFrameRate?: number; + showRenderLoopErrors?: boolean; + automaticallyTrackDataSourceClocks?: boolean; + contextOptions?: any; + sceneMode?: SceneMode; + mapProjection?: MapProjection; + globe?: Globe; + orderIndependentTranslucency?: boolean; + creditContainer?: Element | string; + creditViewport?: Element | string; + dataSources?: DataSourceCollection; + terrainExaggeration?: number; + shadows?: boolean; + terrainShadows?: ShadowMode; + mapMode2D?: MapMode2D; + projectionPicker?: boolean; + requestRenderMode?: boolean; + maximumRenderTimeChange?: number + }); + extend(mixin: Viewer.ViewerMixin, options: any): void; + resize(): void; + forceResize(): void; + render(): void; + isDestroyed(): boolean; + destroy(): void; + zoomTo(target: Entity | Entity[] | EntityCollection | DataSource | Promise, offset?: HeadingPitchRange): Promise; + flyTo(target: Entity | Entity[] | EntityCollection | DataSource | Promise, + options?: { duration?: number; maximumHeight?: number; offset?: HeadingPitchRange }): Promise; + } + + namespace Viewer { + type ViewerMixin = (viewer: Viewer, options: any) => void; + } + + function barycentricCoordinates(point: Cartesian2 | Cartesian3, p0: Cartesian2 | Cartesian3, p1: Cartesian2 | Cartesian3, p2: Cartesian2 | Cartesian3, result?: Cartesian3): Cartesian3; + + function binarySearch(array: any[], itemToFind: any, comparator: binarySearch.Comparator): number; + + namespace binarySearch { + type Comparator = (a: any, b: any) => number; + } + + function cancelAnimationFrame(requestID: number): undefined; + + function clone(object: any, deep?: boolean): any; + + function combine(object1?: any, object2?: any, deep?: boolean): any; + + function destroyObject(object: any, message?: string): undefined; + + function formatError(object: any): string; + + function getFilenameFromUri(uri: string): string; + + function getImagePixels(image: HTMLImageElement): number[]; + + function isArray(value: any): boolean; + + function isLeapYear(year: number): boolean; + + function jsonp(url: string, options?: { parameters?: any; callbackParameterName?: string; proxy?: any }): Promise; + + function loadArrayBuffer(url: string | Promise, headers?: any): Promise; + + function loadBlob(url: string | Promise, headers?: any): Promise; + + function loadImage(url: string | Promise, allowCrossOrigin?: boolean): Promise; + + function loadImageViaBlob(url: string | Promise): Promise; + + function loadJson(url: string | Promise, headers?: any): Promise; + + function loadText(url: string | Promise, headers?: any): Promise; + + function loadWithXhr(options: { url: string | Promise; responseType?: string; method?: string; data?: string; headers?: any; overrideMimeType?: string }): Promise; + + function loadXML(url: string | Promise, headers?: any): Promise; + + function mergeSort(array: any[], comparator: mergeSort.Comparator, userDefinedObject?: any): undefined; + + namespace mergeSort { + type Comparator = (a: any, b: any, userDefinedObject?: any) => number; + } + + function objectToQuery(obj: any): string; + + function pointInsideTriangle(point: Cartesian2 | Cartesian3, p0: Cartesian2 | Cartesian3, p1: Cartesian2 | Cartesian3, p2: Cartesian2 | Cartesian3): boolean; + + function queryToObject(queryString: string): any; + + function requestAnimationFrame(callback: requestAnimationFrame.Callback): number; + + namespace requestAnimationFrame { + type Callback = (timestamp: number) => void; + } + + function sampleTerrain(terrainProvider: TerrainProvider, level: number, positions: Cartographic[]): Promise; + + function subdivideArray(array: any[], numberOfArrays: number): undefined; + + function throttleRequestByServer(url: string, requestFunction: throttleRequestByServer.RequestFunction): Promise; + + namespace throttleRequestByServer { + type RequestFunction = (url: string) => Promise; + } + + function createTangentSpaceDebugPrimitive(options: { geometry: Geometry; length?: number; modelMatrix?: Matrix4 }): Primitive; + + function viewerCesiumInspectorMixin(viewer: Viewer): undefined; + + function viewerDragDropMixin(viewer: Viewer, options?: { dropTarget?: Element | string; clearOnDrop?: boolean; flyToOnDrop?: boolean; clampToGround?: boolean; proxy?: DefaultProxy }): undefined; + + function viewerPerformanceWatchdogMixin(viewer: Viewer): undefined; + + function createCommand(func: () => any, canExecute?: boolean): Command; + + function createTaskProcessorWorker(workerFunction: createTaskProcessorWorker.WorkerFunction): createTaskProcessorWorker.TaskProcessorWorkerFunction; + + namespace createTaskProcessorWorker { + type WorkerFunction = (parameters: any, transferableObjects: any[]) => any; + type TaskProcessorWorkerFunction = (event: any) => void; + } + + enum ClockRange { + UNBOUNDED, + CLAMPED, + LOOP_STOP, + } + + enum ClockStep { + TICK_DEPENDENT, + SYSTEM_CLOCK_MULTIPLIER, + SYSTEM_CLOCK, + } + + enum ComponentDatatype { + BYTE, + UNSIGNED_BYTE, + SHORT, + UNSIGNED_SHORT, + FLOAT, + DOUBLE, + } + + namespace ComponentDatatype { + function getSizeInBytes(componentDatatype: ComponentDatatype): number; + function fromTypedArray(array: Int8Array | Uint8Array | Int16Array | Uint16Array | Float32Array | Float64Array): ComponentDatatype; + function validate(componentDatatype: ComponentDatatype): boolean; + function createTypedArray(componentDatatype: ComponentDatatype, valuesOrLength: number | any[]): Int8Array | Uint8Array | Int16Array | Uint16Array | Float32Array | Float64Array; + function createArrayBufferView(componentDatatype: ComponentDatatype, buffer: ArrayBuffer, byteOffset?: number, length?: number): + Int8Array | Uint8Array | Int16Array | Uint16Array | Float32Array | Float64Array; + } + + enum CornerType { + ROUNDED, + MITERED, + BEVELED, + } + + namespace CubicRealPolynomial { + function computeDiscriminant(a: number, b: number, c: number, d: number): number; + function computeRealRoots(a: number, b: number, c: number, d: number): number[]; + } + + enum ExtrapolationType { + NONE, + HOLD, + EXTRAPOLATE, + } + + namespace FeatureDetection { + function supportsFullscreen(): boolean; + function supportsTypedArrays(): boolean; + function supportsWebAssembly(): boolean; + function supportsWebWorkers(): boolean; + } + + enum Fullscreen { + element, + changeEventName, + errorEventName, + enabled, + fullscreen, + } + + namespace Fullscreen { + function supportsFullscreen(): boolean; + function requestFullscreen(element: any): undefined; + function exitFullscreen(): undefined; + } + + namespace GeometryPipeline { + function toWireframe(geometry: Geometry): Geometry; + function createLineSegmentsForVectors(geometry: Geometry, attributeName?: string, length?: number): Geometry; + function createAttributeLocations(geometry: Geometry): any; + function reorderForPreVertexCache(geometry: Geometry): Geometry; + function reorderForPostVertexCache(geometry: Geometry, cacheCapacity?: number): Geometry; + function fitToUnsignedShortIndices(geometry: Geometry): Geometry[]; + function projectTo2D(geometry: Geometry, attributeName: string, attributeName3D: string, attributeName2D: string, projection?: any): Geometry; + function encodeAttribute(geometry: Geometry, attributeName: string, attributeHighName: string, attributeLowName: string): Geometry; + function transformToWorldCoordinates(instance: GeometryInstance): GeometryInstance; + function computeNormal(geometry: Geometry): Geometry; + function computeBinormalAndTangent(geometry: Geometry): Geometry; + function compressVertices(geometry: Geometry): Geometry; + } + + enum HeightmapTessellator { + DEFAULT_STRUCTURE, + } + + namespace HeightmapTessellator { + function computeVertices(options: { + vertices: any[] | Float32Array; + heightmap: Int8Array | Uint8Array | Int16Array | Uint16Array | Float32Array | Float64Array; + width: number; + height: number; + skirtHeight: number; + nativeRectangle: Rectangle; + rectangle?: Rectangle; + isGeographic?: boolean; + relativetoCenter?: Cartesian3; + ellipsoid?: Ellipsoid; + structure?: any; + structureheightScale?: number; + structureheightOffset?: number; + structureelementsPerHeight?: number; + structurestride?: number; + structureelementMultiplier?: number; + structureisBigEndian?: boolean + }): undefined; + } + + enum HeightReference { + CLAMP_TO_GROUND, + NONE, + RELATIVE_TO_GROUND + } + + class HermitePolynomialApproximation extends InterpolationAlgorithm { + static getRequiredDataPoints(degree: number, inputOrder?: number): number; + } + + enum IndexDatatype { + UNSIGNED_BYTE, + UNSIGNED_SHORT, + UNSIGNED_INT, + } + + namespace IndexDatatype { + function getSizeInBytes(indexDatatype: IndexDatatype): number; + function validate(indexDatatype: IndexDatatype): boolean; + function createTypedArray(numberOfVertices: number, indicesLengthOrArray: any): Uint16Array | Uint32Array; + function createTypedArrayFromArrayBuffer(numberOfVertices: number, sourceArray: ArrayBuffer, byteOffset: number, length: number): Uint16Array | Uint32Array; + } + + // tslint:disable-next-line no-unnecessary-class + class InterpolationAlgorithm { + static type: string; + static getRequiredDataPoints(degree: number): number; + static interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[]; + static interpolate(x: number, xTable: number[], yTable: number[], yStride: number, inputOrder: number, outputOrder: number, result?: number[]): number[]; + } + + enum Intersect { + OUTSIDE, + INTERSECTING, + INSIDE, + } + + namespace IntersectionTests { + function rayPlane(ray: Ray, plane: Plane, result?: Cartesian3): Cartesian3; + function rayTriangle(ray: Ray, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean, result?: Cartesian3): Cartesian3; + function lineSegmentTriangle(v0: Cartesian3, v1: Cartesian3, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean, result?: Cartesian3): Cartesian3; + function raySphere(ray: Ray, sphere: BoundingSphere, result?: any): any; + function lineSegmentSphere(p0: Cartesian3, p1: Cartesian3, sphere: BoundingSphere, result?: any): any; + function rayEllipsoid(ray: Ray, ellipsoid: Ellipsoid): any; + function grazingAltitudeLocation(ray: Ray, ellipsoid: Ellipsoid): Cartesian3; + function lineSegmentPlane(endPoint0: Cartesian3, endPoint1: Cartesian3, plane: Plane, result?: Cartesian3): Cartesian3; + function trianglePlaneIntersection(p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, plane: Plane): any; + } + + namespace Intersections2D { + function clipTriangleAtAxisAlignedThreshold(threshold: number, keepAbove: boolean, u0: number, u1: number, u2: number, result?: number[]): number[]; + function computeBarycentricCoordinates(x: number, y: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, result?: Cartesian3): Cartesian3; + } + + enum Iso8601 { + MINIMUM_VALUE, + MAXIMUM_VALUE, + MAXIMUM_INTERVAL, + } + + enum KeyboardEventModifier { + SHIFT, + CTRL, + ALT, + } + + class LagrangePolynomialApproximation extends InterpolationAlgorithm {} + + class LinearApproximation extends InterpolationAlgorithm {} + + enum MapMode2D { + INFINITE_SCROLL, + ROTATE + } + + enum Math { + EPSILON1, + EPSILON2, + EPSILON3, + EPSILON4, + EPSILON5, + EPSILON6, + EPSILON7, + EPSILON8, + EPSILON9, + EPSILON10, + EPSILON11, + EPSILON12, + EPSILON13, + EPSILON14, + EPSILON15, + EPSILON16, + EPSILON17, + EPSILON18, + EPSILON19, + EPSILON20, + GRAVITATIONALPARAMETER, + SOLAR_RADIUS, + LUNAR_RADIUS, + SIXTY_FOUR_KILOBYTES, + PI, + ONE_OVER_PI, + PI_OVER_TWO, + PI_OVER_THREE, + PI_OVER_FOUR, + PI_OVER_SIX, + THREE_PI_OVER_TWO, + TWO_PI, + ONE_OVER_TWO_PI, + RADIANS_PER_DEGREE, + DEGREES_PER_RADIAN, + RADIANS_PER_ARCSECOND, + } + + namespace Math { + function sign(value: number): number; + function signNotZero(value: number): number; + function toSNorm(value: number): number; + function fromSNorm(value: number): number; + function sinh(value: number): number; + function cosh(value: number): number; + function lerp(p: number, q: number, time: number): number; + function toRadians(degrees: number): number; + function toDegrees(radians: number): number; + function convertLongitudeRange(angle: number): number; + function negativePiToPi(angle: number): number; + function zeroToTwoPi(angle: number): number; + function mod(m: number, n: number): number; + function equalsEpsilon(left: number, right: number, relativeEpsilon: number, absoluteEpsilon?: number): boolean; + function factorial(n: number): number; + function incrementWrap(n?: number, maximumValue?: number, minimumValue?: number): number; + function isPowerOfTwo(n: number): boolean; + function nextPowerOfTwo(n: number): number; + function clamp(value: number, min: number, max: number): number; + function setRandomNumberSeed(seed: number): undefined; + function nextRandomNumber(): number; + function acosClamped(value: number): number; + function asinClamped(value: number): number; + function chordLength(angle: number, radius: number): number; + } + + // tslint:disable-next-line no-unnecessary-class + abstract class Packable { + static packedLength: number; + static pack(value: any, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: any): Packable; + } + + enum PackableForInterpolation { + packedInterpolationLength, + } + + namespace PackableForInterpolation { + function convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): number[]; + function unpackInterpolationResult(array: number[], sourceArray: number[], startingIndex?: number, lastIndex?: number, result?: any): any; + } + + enum PixelFormat { + DEPTH_COMPONENT, + DEPTH_STENCIL, + ALPHA, + RGB, + RGBA, + LUMINANCE, + LUMINANCE_ALPHA, + } + + enum PrimitiveType { + POINTS, + LINES, + LINE_LOOP, + LINE_STRIP, + TRIANGLES, + TRIANGLE_STRIP, + TRIANGLE_FAN, + } + + namespace QuadraticRealPolynomial { + function computeDiscriminant(a: number, b: number, c: number): number; + function computeRealRoots(a: number, b: number, c: number): number[]; + } + + namespace QuarticRealPolynomial { + function computeDiscriminant(a: number, b: number, c: number, d: number, e: number): number; + function computeRealRoots(a: number, b: number, c: number, d: number, e: number): number[]; + } + + enum ReferenceFrame { + FIXED, + INERTIAL, + } + + enum ScreenSpaceEventType { + LEFT_DOWN, + LEFT_UP, + LEFT_CLICK, + LEFT_DOUBLE_CLICK, + RIGHT_DOWN, + RIGHT_UP, + RIGHT_CLICK, + RIGHT_DOUBLE_CLICK, + MIDDLE_DOWN, + MIDDLE_UP, + MIDDLE_CLICK, + MIDDLE_DOUBLE_CLICK, + MOUSE_MOVE, + WHEEL, + PINCH_START, + PINCH_END, + PINCH_MOVE, + } + + namespace Simon1994PlanetaryPositions { + function computeSunPositionInEarthInertialFrame(julianDate?: JulianDate, result?: Cartesian3): Cartesian3; + function computeMoonPositionInEarthInertialFrame(julianDate?: JulianDate, result?: Cartesian3): Cartesian3; + } + + class ShadowMap { + darkness: number; + enabled: boolean; + maximumDistance: number; + normalOffset: boolean; + size: number; + softShadows: boolean; + constructor(obtions: { + lightCamera: Camera; + enabled?: boolean; + isPointLight?: boolean; + pointLightRadius?: number; + cascadesEnabled?: boolean; + numberOfCascades?: number; + maximumDistance?: number; + size?: number; + softShadows?: boolean; + darkness?: number; + normalOffset?: boolean + }); + } + + enum ShadowMode { + CAST_ONLY, + DISABLED, + ENABLED, + RECEIVE_ONLY + } + + enum TimeStandard { + UTC, + TAI, + } + + namespace Transforms { + function eastNorthUpToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4; + function northEastDownToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4; + function northUpEastToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4; + function headingPitchRollToFixedFrame(origin: Cartesian3, heading: number, pitch: number, roll: number, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4; + function headingPitchRollQuaternion(origin: Cartesian3, heading: number, pitch: number, roll: number, ellipsoid?: Ellipsoid, result?: Quaternion): Quaternion; + function computeTemeToPseudoFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3; + function preloadIcrfFixed(timeInterval: TimeInterval): Promise; + function computeIcrfToFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3; + function computeFixedToIcrfMatrix(date: JulianDate, result?: Matrix3): Matrix3; + function pointToWindowCoordinates(modelViewProjectionMatrix: Matrix4, viewportTransformation: Matrix4, point: Cartesian3, result?: Cartesian2): Cartesian2; + } + + namespace TridiagonalSystemSolver { + function solve(diagonal: number[], lower: number[], upper: number[], right: Cartesian3[]): Cartesian3[]; + } + + enum Visibility { + NONE, + PARTIAL, + FULL, + } + + enum WindingOrder { + CLOCKWISE, + COUNTER_CLOCKWISE, + } + + enum StripeOrientation { + HORIZONTAL, + VERTICAL, + } + + enum BingMapsStyle { + AERIAL, + AERIAL_WITH_LABELS, + ROAD, + ORDNANCE_SURVEY, + COLLINS_BART, + } + + enum BlendEquation { + ADD, + SUBTRACT, + REVERSE_SUBTRACT, + } + + enum BlendFunction { + ZERO, + ONE, + SOURCE_COLOR, + ONE_MINUS_SOURCE_COLOR, + DESTINATION_COLOR, + ONE_MINUS_DESTINATION_COLOR, + SOURCE_ALPHA, + ONE_MINUS_SOURCE_ALPHA, + DESTINATION_ALPHA, + ONE_MINUS_DESTINATION_ALPHA, + CONSTANT_COLOR, + ONE_MINUS_CONSTANT_COLOR, + CONSTANT_ALPHA, + ONE_MINUS_CONSTANT_ALPHA, + SOURCE_ALPHA_SATURATE, + } + + enum BlendingState { + DISABLED, + ALPHA_BLEND, + PRE_MULTIPLIED_ALPHA_BLEND, + ADDITIVE_BLEND, + } + + enum BlendOption { + OPAQUE, + OPAQUE_AND_TRANSLUCENT, + TRANSLUCENT + } + + enum CameraEventType { + LEFT_DRAG, + RIGHT_DRAG, + MIDDLE_DRAG, + WHEEL, + PINCH, + } + + enum CullFace { + FRONT, + BACK, + FRONT_AND_BACK, + } + + enum DepthFunction { + NEVER, + LESS, + EQUAL, + LESS_OR_EQUAL, + GREATER, + NOT_EQUAL, + GREATER_OR_EQUAL, + ALWAYS, + } + + enum HorizontalOrigin { + CENTER, + LEFT, + RIGHT, + } + + enum LabelStyle { + FILL, + OUTLINE, + FILL_AND_OUTLINE, + } + + enum ModelAnimationLoop { + NONE, + REPEAT, + MIRRORED_REPEAT, + } + + enum SceneMode { + MORPHING, + COLUMBUS_VIEW, + SCENE2D, + SCENE3D, + } + + namespace SceneMode { + function getMorphTime(value: SceneMode): number; + } + + namespace SceneTransforms { + function wgs84ToWindowCoordinates(scene: Scene, position: Cartesian3, result?: Cartesian2): Cartesian2; + function wgs84ToDrawingBufferCoordinates(scene: Scene, position: Cartesian3, result?: Cartesian2): Cartesian2; + } + + enum StencilFunction { + NEVER, + LESS, + EQUAL, + LESS_OR_EQUAL, + GREATER, + NOT_EQUAL, + GREATER_OR_EQUAL, + ALWAYS, + } + + enum StencilOperation { + ZERO, + KEEP, + REPLACE, + INCREMENT, + DECREMENT, + INVERT, + INCREMENT_WRAP, + DECREMENT_WRAP, + } + + enum VerticalOrigin { + CENTER, + BOTTOM, + TOP, + } + + function createOpenStreetMapImageryProvider(options: { + url?: string, + fileExtension?: string, + rectangle?: Rectangle, + minimumLevel?: number, + maximumLevel?: number, + ellipsoid?: Ellipsoid, + credit?: Credit | string + }): UrlTemplateImageryProvider; + + function createTileMapServiceImageryProvider(options: { + url?: string, + fileExtension?: string, + credit?: Credit | string, + minimumLevel?: number, + maximumLevel?: number, + rectangle?: Rectangle, + tilingScheme?: TilingScheme, + ellipsoid?: Ellipsoid, + tileWidth?: number, + tileHeight?: number, + flipXY?: boolean + }): UrlTemplateImageryProvider; + + function createWorldImagery(options: { + style?: any // IonWorldImageryStyle + }): IonImageryProvider; + + function createWorldTerrain(options: { + requestVertexNormals?: boolean, + requestWaterMask?: boolean + }): CesiumTerrainProvider; + + class UrlTemplateImageryProvider extends ImageryProvider { + url: string; + pickFeaturesUrl: string; + urlSchemeZeroPadding: {}; + subdomains: string | string[]; + ellipsoid: Ellipsoid; + getFeatureInfoFormats: GetFeatureInfoFormat[]; + enablePickFeatures: boolean; + + constructor(options: { + url: string, + pickFeaturesUrl?: string, + urlSchemeZeroPadding?: {}, + subdomains?: string | string[] + proxy?: {}, + credit?: Credit | string, + minimumLevel?: number, + maximumLevel?: number, + rectangle?: Rectangle, + tilingScheme?: TilingScheme, + ellipsoid?: Ellipsoid, + tileWidth?: number, + tileHeight?: number, + hasAlphaChannel?: boolean, + getFeatureInfoFormats?: GetFeatureInfoFormat[], + enablePickFeatures?: boolean + }); + reinitialize(options: Promise | object): void; + } + + class Resource { + static DEFAULT: Resource; + static readonly isBlobSupported: boolean; + readonly extension: string; + hasHeaders: boolean; + headers: any; + isBlobUri: boolean; + isCrossOriginUrl: boolean; + isDataUri: boolean; + proxy: DefaultProxy; + readonly queryParameters: any; + request: Request; + retryAttempts: number; + retryCallback: () => void; + readonly templateValues: any; + url: string; + static delete(options?: { url: string; data?: any; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request; responseType?: string; overrideMimeType?: string }): Promise | undefined; + static fetch(options?: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request; responseType?: string; overrideMimeType?: string }): Promise | undefined; + static fetchArrayBuffer(options?: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request }): Promise | undefined; + static fetchBlob(options?: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request }): Promise | undefined; + static fetchImage(options?: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request; preferBlob?: boolean }): Promise | undefined; + static fetchJson(options?: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request }): Promise | undefined; + static fetchJsonp(options?: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request; callbackParameterName?: string }): Promise | undefined; + static fetchText(options?: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request }): Promise | undefined; + static fetchXml(options?: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request }): Promise | undefined; + static head(options?: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request; responseType?: string; overrideMimeType?: string }): Promise | undefined; + static options(options?: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request; responseType?: string; overrideMimeType?: string }): Promise | undefined; + static patch(options?: { url: string; data?: any; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request; responseType?: string; overrideMimeType?: string }): Promise | undefined; + static post(options?: { url: string; data?: any; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request; responseType?: string; overrideMimeType?: string }): Promise | undefined; + static put(options?: { url: string; data?: any; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request; responseType?: string; overrideMimeType?: string }): Promise | undefined; + constructor(options?: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request }); + addQueryParameters(params: any, useAsDefault: boolean): void; + addTemplateValues(template: any, useAsDefault: boolean): void; + appendForwardSlash(): void; + appendQueryParameters(params: any): void; + clone(result: Resource): Resource; + delete(options?: { responseType?: string; headers?: any; overrideMimeType?: string }): Promise | undefined; + fetch(options?: { responseType?: string; headers?: any; overrideMimeType?: string }): Promise | undefined; + fetchArrayBuffer(): Promise | undefined; + fetchBlob(): Promise | undefined; + fetchImage(preferBlob: boolean): Promise | undefined; + fetchJson(): Promise | undefined; + fetchJsonp(callbackParameterName: string): Promise | undefined; + fetchText(): Promise | undefined; + fetchXml(): Promise | undefined; + getBaseUri(includeQuery: boolean): string; + getDerivedResource(options: {url?: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request; preserveQueryParameters?: boolean}): Resource; + getUrlComponent(query: boolean, proxy: boolean): string; + head(options?: {responseType?: string; headers?: any; overrideMimeType?: string}): Promise | undefined; + options(options?: { responseType?: string; headers?: any; overrideMimeType?: string }): Promise | undefined; + patch(data: any, options?: { responseType?: string; headers?: any; overrideMimeType?: string }): Promise | undefined; + post(data: any, options?: { data?: any; responseType?: string; headers?: any; overrideMimeType?: string }): Promise | undefined; + put(data: any, options?: { responseType?: string; headers?: any; overrideMimeType?: string }): Promise | undefined; + setQueryParameters(params: any, useAsDefault: boolean): void; + setTemplateValues(template: any, useAsDefault: boolean): void; + } + + namespace Resource { + type RetryCallback = (resource: Resource, error: Error) => void; + } + + function defined(value: any): boolean; + + namespace buildModuleUrl { + function setBaseUrl(value: string): undefined; + } +} diff --git a/types/cesium/test/cesium-global.test.ts b/types/cesium/test/cesium-global.test.ts new file mode 100644 index 0000000000..8974e56542 --- /dev/null +++ b/types/cesium/test/cesium-global.test.ts @@ -0,0 +1,48 @@ +Cesium.buildModuleUrl.setBaseUrl('/assets/cesium/'); + +const viewer = new Cesium.Viewer('#cesium', { + sceneMode: Cesium.SceneMode.COLUMBUS_VIEW, + imageryProvider: new Cesium.IonImageryProvider({ assetId: 3845 }), + baseLayerPicker: false, + geocoder: false, +}); + +const midnight = Cesium.JulianDate.fromDate(new Date(2018, 5, 14)); +const prop = new Cesium.SampledPositionProperty(); + +const pos = Cesium.Cartesian3.fromDegrees(1, 2, 3); +const time = Cesium.JulianDate.addSeconds(midnight, 12345, new Cesium.JulianDate()); +prop.addSample(time, pos); +viewer.entities.add(new Cesium.Entity({ + position: pos, + point: new Cesium.PointGraphics({ + color: Cesium.Color.fromCssColorString('#123123'), + pixelSize: 2 + }) +})); + +const objStart = Cesium.JulianDate.addSeconds(midnight, 12340, new Cesium.JulianDate()); +const objStop = Cesium.JulianDate.addSeconds(midnight, 12350, new Cesium.JulianDate()); + +const entity = new Cesium.Entity({ + name: 'TEST', + availability: new Cesium.TimeIntervalCollection([ + new Cesium.TimeInterval({ + start: objStart, + stop: objStop + }) + ]), + position: prop, + orientation: new Cesium.VelocityOrientationProperty(prop), + path: new Cesium.PathGraphics({ + resolution: 5, + width: 3, + material: new Cesium.ColorMaterialProperty(Cesium.Color.fromCssColorString('#223344')), + leadTime: 0 + }), + model: new Cesium.ModelGraphics({ + uri: 'http://assets.agi.com/models/rv1.gltf', + minimumPixelSize: 48 + }) +}); +viewer.entities.add(entity); diff --git a/types/cesium/test/cesium-module.test.ts b/types/cesium/test/cesium-module.test.ts new file mode 100644 index 0000000000..726daf7df2 --- /dev/null +++ b/types/cesium/test/cesium-module.test.ts @@ -0,0 +1,50 @@ +import * as Cesium from 'cesium'; + +Cesium.buildModuleUrl.setBaseUrl('/assets/cesium/'); + +const viewer = new Cesium.Viewer('#cesium', { + sceneMode: Cesium.SceneMode.COLUMBUS_VIEW, + imageryProvider: new Cesium.IonImageryProvider({ assetId: 3845 }), + baseLayerPicker: false, + geocoder: false, +}); + +const midnight = Cesium.JulianDate.fromDate(new Date(2018, 5, 14)); +const prop = new Cesium.SampledPositionProperty(); + +const pos = Cesium.Cartesian3.fromDegrees(1, 2, 3); +const time = Cesium.JulianDate.addSeconds(midnight, 12345, new Cesium.JulianDate()); +prop.addSample(time, pos); +viewer.entities.add(new Cesium.Entity({ + position: pos, + point: new Cesium.PointGraphics({ + color: Cesium.Color.fromCssColorString('#123123'), + pixelSize: 2 + }) +})); + +const objStart = Cesium.JulianDate.addSeconds(midnight, 12340, new Cesium.JulianDate()); +const objStop = Cesium.JulianDate.addSeconds(midnight, 12350, new Cesium.JulianDate()); + +const entity = new Cesium.Entity({ + name: 'TEST', + availability: new Cesium.TimeIntervalCollection([ + new Cesium.TimeInterval({ + start: objStart, + stop: objStop + }) + ]), + position: prop, + orientation: new Cesium.VelocityOrientationProperty(prop), + path: new Cesium.PathGraphics({ + resolution: 5, + width: 3, + material: new Cesium.ColorMaterialProperty(Cesium.Color.fromCssColorString('#223344')), + leadTime: 0 + }), + model: new Cesium.ModelGraphics({ + uri: 'http://assets.agi.com/models/rv1.gltf', + minimumPixelSize: 48 + }) +}); +viewer.entities.add(entity); diff --git a/types/cesium/tsconfig.json b/types/cesium/tsconfig.json new file mode 100644 index 0000000000..e82d8ca16a --- /dev/null +++ b/types/cesium/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "test/cesium-global.test.ts", + "test/cesium-module.test.ts" + ] +} diff --git a/types/cesium/tslint.json b/types/cesium/tslint.json new file mode 100644 index 0000000000..4c4fc86ace --- /dev/null +++ b/types/cesium/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "strict-export-declare-modifiers": false + } +} diff --git a/types/chai-jest-snapshot/chai-jest-snapshot-tests.ts b/types/chai-jest-snapshot/chai-jest-snapshot-tests.ts index c93c4a1d04..cd35998db8 100644 --- a/types/chai-jest-snapshot/chai-jest-snapshot-tests.ts +++ b/types/chai-jest-snapshot/chai-jest-snapshot-tests.ts @@ -1,4 +1,4 @@ -import chaiJestSnapshot from 'chai-jest-snapshot'; +import * as chaiJestSnapshot from 'chai-jest-snapshot'; import { expect } from 'chai'; chai.use(chaiJestSnapshot); diff --git a/types/chai-jest-snapshot/index.d.ts b/types/chai-jest-snapshot/index.d.ts index 470e4fa423..27ec049b14 100644 --- a/types/chai-jest-snapshot/index.d.ts +++ b/types/chai-jest-snapshot/index.d.ts @@ -40,4 +40,4 @@ interface ChaiJestSnapshot { } declare var ChaiJestSnapshot: ChaiJestSnapshot; -export default ChaiJestSnapshot; +export = ChaiJestSnapshot; diff --git a/types/chai-spies/chai-spies-tests.ts b/types/chai-spies/chai-spies-tests.ts index 1d99f0add2..f5247ba13f 100644 --- a/types/chai-spies/chai-spies-tests.ts +++ b/types/chai-spies/chai-spies-tests.ts @@ -88,6 +88,27 @@ spyStringArg('foo'); expect(spyStringArg).to.have.been.called.always.with.exactly('foo'); spyStringArg.should.have.been.called.always.with.exactly('foo'); +// .first / .second / .third +const spyStringIteratedArg = chai.spy((arg: string) => arg); +spyStringIteratedArg('foo'); +spyStringIteratedArg('bar'); +spyStringIteratedArg('baz'); +expect(spyStringIteratedArg).to.have.been.first.called.with('foo'); +spyStringIteratedArg.should.have.been.first.called.with('foo'); +expect(spyStringIteratedArg).to.have.been.first.called.with('bar'); +spyStringIteratedArg.should.have.been.first.called.with('bar'); +expect(spyStringIteratedArg).to.have.been.first.called.with('baz'); +spyStringIteratedArg.should.have.been.first.called.with('baz'); + +// .nth +const spyStringNthArg = chai.spy((arg: string) => arg); +spyStringNthArg('foo'); +spyStringNthArg('bar'); +expect(spyStringNthArg).on.nth(1).be.called.with('foo'); +spyStringNthArg.should.on.nth(1).be.called.with('foo'); +expect(spyStringNthArg).on.nth(2).be.called.with('bar'); +spyStringNthArg.should.on.nth(2).be.called.with('bar'); + // .once expect(spy).to.have.been.called.once; expect(spy).to.not.have.been.called.once; diff --git a/types/chai-spies/index.d.ts b/types/chai-spies/index.d.ts index ffed6e594b..75f702ca37 100644 --- a/types/chai-spies/index.d.ts +++ b/types/chai-spies/index.d.ts @@ -10,6 +10,10 @@ declare namespace Chai { spy: ChaiSpies.Spy; } + interface LanguageChains { + on: Assertion; + } + interface Assertion { /** * ####.spy @@ -31,6 +35,28 @@ declare namespace Chai { * Note that ```called``` can be used as a chainable method. */ called: ChaiSpies.Called; + + /** + * * ####.been + * * Assert that something has been spied on. Negation passes through. + * * ```ts + * * expect(spy).to.have.been.called(); + * * spy.should.have.been.called(); + * ``` + * Note that ```been``` can be used as a chainable method. + */ + been: ChaiSpies.Been; + + /** + * * ####.nth (function) + * * Assert that something has been spied on on a certain index. Negation passes through. + * * ```ts + * * expect(spy).on.nth(5).be.called.with('foobar'); + * * spy.should.on.nth(5).be.called.with('foobar'); + * ``` + * Note that ```nth``` can be used as a chainable method. + */ + nth(index: number): Assertion; } } @@ -224,6 +250,47 @@ declare namespace ChaiSpies { lt(n: number): Chai.Assertion; } + interface Been extends Chai.Assertion { + (): Chai.Assertion; + called: Called; + + /** + * ####.first + * Assert that a spy has been called first. + * ```ts + * expect(spy).to.have.been.called.first; + * expect(spy).to.not.have.been.called.first; + * spy.should.have.been.called.first; + * spy.should.not.have.been.called.first; + * ``` + */ + first: Chai.Assertion; + + /** + * ####.second + * Assert that a spy has been called second. + * ```ts + * expect(spy).to.have.been.called.second; + * expect(spy).to.not.have.been.called.second; + * spy.should.have.been.called.second; + * spy.should.not.have.been.called.second; + * ``` + */ + second: Chai.Assertion; + + /** + * ####.third + * Assert that a spy has been called third. + * ```ts + * expect(spy).to.have.been.called.third; + * expect(spy).to.not.have.been.called.third; + * spy.should.have.been.called.third; + * spy.should.not.have.been.called.third; + * ``` + */ + third: Chai.Assertion; + } + interface With { /** * ####.with diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 83bf5267fd..0fa14a71c8 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -10,6 +10,8 @@ // Guillaume Rodriguez // Sergey Rubanov // Simon Archer +// Ken Elkabany +// Slavik Nychkalo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -36,6 +38,7 @@ declare class Chart { canvas: HTMLCanvasElement|null; chartArea: Chart.ChartArea; static pluginService: PluginServiceStatic; + static plugins: PluginServiceStatic; static defaults: { global: Chart.ChartOptions & Chart.ChartFontOptions; @@ -55,40 +58,40 @@ declare class PluginServiceStatic { } interface PluginServiceRegistrationOptions { - beforeInit?(chartInstance: Chart): void; - afterInit?(chartInstance: Chart): void; + beforeInit?(chartInstance: Chart, options?: any): void; + afterInit?(chartInstance: Chart, options?: any): void; - resize?(chartInstance: Chart, newChartSize: Size): void; + resize?(chartInstance: Chart, newChartSize: Size, options?: any): void; - beforeUpdate?(chartInstance: Chart): void; - afterScaleUpdate?(chartInstance: Chart): void; - beforeDatasetsUpdate?(chartInstance: Chart): void; - afterDatasetsUpdate?(chartInstance: Chart): void; - afterUpdate?(chartInstance: Chart): void; + beforeUpdate?(chartInstance: Chart, options?: any): void; + afterScaleUpdate?(chartInstance: Chart, options?: any): void; + beforeDatasetsUpdate?(chartInstance: Chart, options?: any): void; + afterDatasetsUpdate?(chartInstance: Chart, options?: any): void; + afterUpdate?(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): void; + beforeRender?(chartInstance: Chart, options?: any): void; // Easing is for animation - beforeDraw?(chartInstance: Chart, easing: string): void; - afterDraw?(chartInstance: Chart, easing: string): void; + 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): void; - afterDatasetsDraw?(chartInstance: Chart, easing: string): void; + beforeDatasetsDraw?(chartInstance: Chart, easing: string, options?: any): void; + afterDatasetsDraw?(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): void; + beforeTooltipDraw?(chartInstance: Chart, tooltipData?: any, options?: any): void; // Called after drawing the `tooltip`. Note that this hook will not, // be called if the tooltip drawing has been previously cancelled. - afterTooltipDraw?(chartInstance: Chart): void; + 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): void; - afterEvent?(chartInstance: Chart, event: Event): void; + beforeEvent?(chartInstance: Chart, event: Event, options?: any): void; + afterEvent?(chartInstance: Chart, event: Event, options?: any): void; } interface Size { @@ -97,7 +100,7 @@ interface Size { } declare namespace Chart { - type ChartType = 'line' | 'bar' | 'radar' | 'doughnut' | 'polarArea' | 'bubble' | 'pie'; + type ChartType = 'line' | 'bar' | 'horizontalBar' | 'radar' | 'doughnut' | 'polarArea' | 'bubble' | 'pie'; type TimeUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year'; @@ -168,6 +171,7 @@ declare namespace Chart { x?: number | string | Date; y?: number | string | Date; r?: number; + t?: number | string | Date; } interface ChartConfiguration { @@ -219,7 +223,7 @@ declare namespace Chart { interface ChartTitleOptions { display?: boolean; position?: PositionType; - fullWdith?: boolean; + fullWidth?: boolean; fontSize?: number; fontFamily?: string; fontColor?: ChartColor; @@ -422,6 +426,7 @@ declare namespace Chart { padding?: number; reverse?: boolean; showLabelBackdrop?: boolean; + source?: 'auto' | 'data' | 'labels'; } interface AngleLineOptions { @@ -509,8 +514,10 @@ declare namespace Chart { ticks?: TickOptions; gridLines?: GridLineOptions; barThickness?: number; + maxBarThickness?: number; scaleLabel?: ScaleTitleOptions; time?: TimeScale; + offset?: boolean; beforeUpdate?(scale?: any): void; beforeSetDimension?(scale?: any): void; beforeDataLimits?(scale?: any): void; @@ -530,6 +537,7 @@ declare namespace Chart { interface ChartXAxe extends CommonAxe { categoryPercentage?: number; barPercentage?: number; + distribution?: 'linear' | 'series'; } // tslint:disable-next-line no-empty-interface diff --git a/types/chartist/chartist-tests.ts b/types/chartist/chartist-tests.ts index 13a7c7dd1c..270e6e0970 100644 --- a/types/chartist/chartist-tests.ts +++ b/types/chartist/chartist-tests.ts @@ -1,429 +1,485 @@ import Chartist = require("chartist"); + Chartist.escapingMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - '\'': ''', + '&': '&', + '<': '<', + '>': '>', + '"': '"', + '\'': ''', }; Chartist.precision = 8; new Chartist.Line('.ct-chart', { - labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'], - series: [ - [12, 9, 7, 8, 5], - [2, 1, 3.5, 7, 3], - [1, 3, 4, 5, 6] - ] + labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'], + series: [ + [12, 9, 7, 8, 5], + [2, 1, 3.5, 7, 3], + [1, 3, 4, 5, 6] + ] }, { fullWidth: true, chartPadding: { - right: 40 + right: 40 } - }); - -var lineChart = new Chartist.Line('.ct-chart', { - labels: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], - series: [ - [5, 5, 10, 8, 7, 5, 4, null, null, null, 10, 10, 7, 8, 6, 9], - [10, 15, null, 12, null, 10, 12, 15, null, null, 12, null, 14, null, null, null], - [null, null, null, null, 3, 4, 1, 3, 4, 6, 7, 9, 5, null, null, null] - ] -}, { - fullWidth: true, - chartPadding: { - right: 10 - }, - low: 0 - }); - -new Chartist.Line('.ct-chart', { - labels: ['1', '2', '3', '4', '5', '6'], - series: [ - { - name: 'Fibonacci sequence', - data: [1, 2, 3, 5, 8, 13] - }, - { - name: 'Golden section', - data: [1, 1.618, 2.618, 4.236, 6.854, 11.09] - } - ] }); +var lineChart = new Chartist.Line('.ct-chart', { + labels: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], + series: [ + [5, 5, 10, 8, 7, 5, 4, null, null, null, 10, 10, 7, 8, 6, 9], + [10, 15, null, 12, null, 10, 12, 15, null, null, 12, null, 14, null, null, null], + [null, null, null, null, 3, 4, 1, 3, 4, 6, 7, 9, 5, null, null, null] + ] +}, { + fullWidth: true, + chartPadding: { + right: 10 + }, + low: 0 +}); + +new Chartist.Line('.ct-chart', { + labels: ['1', '2', '3', '4', '5', '6'], + series: [ + { + name: 'Fibonacci sequence', + data: [1, 2, 3, 5, 8, 13] + }, + { + name: 'Golden section', + data: [1, 1.618, 2.618, 4.236, 6.854, 11.09] + } + ] +}); + + +// This example was taken here: https://gionkunz.github.io/chartist-js/examples.html#example-line-series-override +new Chartist.Line('.ct-chart', { + labels: ['1', '2', '3', '4', '5', '6', '7', '8'], + // Naming the series with the series object array notation + series: [{ + name: 'series-1', + data: [5, 2, -4, 2, 0, -2, 5, -3] + }, { + name: 'series-2', + data: [4, 3, 5, 3, 1, 3, 6, 4] + }, { + name: 'series-3', + data: [2, 4, 3, 1, 4, 5, 3, 2] + }] +}, { + fullWidth: true, + // Within the series options you can use the series names + // to specify configuration that will only be used for the + // specific series. + series: { + 'series-1': { + lineSmooth: Chartist.Interpolation.step() + }, + 'series-2': { + lineSmooth: Chartist.Interpolation.simple(), + showArea: true + }, + 'series-3': { + showPoint: false + } + } +}, [ + // You can even use responsive configuration overrides to + // customize your series configuration even further! + ['screen and (max-width: 320px)', { + series: { + 'series-1': { + lineSmooth: Chartist.Interpolation.none() + }, + 'series-2': { + lineSmooth: Chartist.Interpolation.none(), + showArea: false + }, + 'series-3': { + lineSmooth: Chartist.Interpolation.none(), + showPoint: true + } + } + }] +]); + + var data = { - series: [5, 3, 4] + series: [5, 3, 4] }; -var sum = (a: number, b: number) => { return a + b }; +var sum = (a: number, b: number) => { + return a + b +}; new Chartist.Pie('.ct-chart', data, { - labelInterpolationFnc: (value: number) => { - return Math.round(value / data.series.reduce(sum) * 100) + '%'; - } + labelInterpolationFnc: (value: number) => { + return Math.round(value / data.series.reduce(sum) * 100) + '%'; + } }); new Chartist.Pie('.ct-chart', { - series: [20, 10, 30, 40] + series: [20, 10, 30, 40] }, { donut: true, donutWidth: 60, startAngle: 270, total: 200, showLabel: false - }); +}); // Animation Donut example var chart = new Chartist.Pie('.ct-chart', { - series: [10, 20, 50, 20, 5, 50, 15], - labels: [1, 2, 3, 4, 5, 6, 7] + series: [10, 20, 50, 20, 5, 50, 15], + labels: [1, 2, 3, 4, 5, 6, 7] }, { donut: true, showLabel: false - }); +}); chart.on('draw', (data: any) => { - if (data.type === 'slice') { - // Get the total path length in order to use for dash array animation - var pathLength = data.element._node.getTotalLength(); + if (data.type === 'slice') { + // Get the total path length in order to use for dash array animation + var pathLength = data.element._node.getTotalLength(); - // Set a dasharray that matches the path length as prerequisite to animate dashoffset - data.element.attr({ - 'stroke-dasharray': pathLength + 'px ' + pathLength + 'px' - }); + // Set a dasharray that matches the path length as prerequisite to animate dashoffset + data.element.attr({ + 'stroke-dasharray': pathLength + 'px ' + pathLength + 'px' + }); - // Create animation definition while also assigning an ID to the animation for later sync usage - var animationDefinition: Chartist.IChartistAnimations = { - 'stroke-dashoffset': { - id: 'anim' + data.index, - dur: 1000, - from: -pathLength + 'px', - to: '0px', - easing: Chartist.Svg.Easing.easeOutQuint, - // We need to use `fill: 'freeze'` otherwise our animation will fall back to initial (not visible) - fill: 'freeze' - } - }; + // Create animation definition while also assigning an ID to the animation for later sync usage + var animationDefinition: Chartist.IChartistAnimations = { + 'stroke-dashoffset': { + id: 'anim' + data.index, + dur: 1000, + from: -pathLength + 'px', + to: '0px', + easing: Chartist.Svg.Easing.easeOutQuint, + // We need to use `fill: 'freeze'` otherwise our animation will fall back to initial (not visible) + fill: 'freeze' + } + }; - // If this was not the first slice, we need to time the animation so that it uses the end sync event of the previous animation - if (data.index !== 0) { - animationDefinition['stroke-dashoffset'].begin = 'anim' + (data.index - 1) + '.end'; + // If this was not the first slice, we need to time the animation so that it uses the end sync event of the previous animation + if (data.index !== 0) { + animationDefinition['stroke-dashoffset'].begin = 'anim' + (data.index - 1) + '.end'; + } + + // We need to set an initial value before the animation starts as we are not in guided mode which would do that for us + data.element.attr({ + 'stroke-dashoffset': -pathLength + 'px' + }); + + // We can't use guided mode as the animations need to rely on setting begin manually + // See http://gionkunz.github.io/chartist-js/api-documentation.html#chartistsvg-function-animate + data.element.animate(animationDefinition, false); } - - // We need to set an initial value before the animation starts as we are not in guided mode which would do that for us - data.element.attr({ - 'stroke-dashoffset': -pathLength + 'px' - }); - - // We can't use guided mode as the animations need to rely on setting begin manually - // See http://gionkunz.github.io/chartist-js/api-documentation.html#chartistsvg-function-animate - data.element.animate(animationDefinition, false); - } }); new Chartist.Bar('.ct-chart', { - labels: ['XS', 'S', 'M', 'L', 'XL', 'XXL', 'XXXL'], - series: [20, 60, 120, 200, 180, 20, 10] + labels: ['XS', 'S', 'M', 'L', 'XL', 'XXL', 'XXXL'], + series: [20, 60, 120, 200, 180, 20, 10] }, { distributeSeries: true - }); +}); new Chartist.Bar('.ct-chart', { - labels: ['Quarter 1', 'Quarter 2', 'Quarter 3', 'Quarter 4'], - series: [ - [5, 4, 3, 7], - [3, 2, 9, 5], - [1, 5, 8, 4], - [2, 3, 4, 6], - [4, 1, 2, 1] - ] + labels: ['Quarter 1', 'Quarter 2', 'Quarter 3', 'Quarter 4'], + series: [ + [5, 4, 3, 7], + [3, 2, 9, 5], + [1, 5, 8, 4], + [2, 3, 4, 6], + [4, 1, 2, 1] + ] }, { // Default mobile configuration stackBars: true, axisX: { - labelInterpolationFnc: (value: string) => { - return value.split(/\s+/).map((word: string) => { - return word[0]; - }).join(''); - } + labelInterpolationFnc: (value: string) => { + return value.split(/\s+/).map((word: string) => { + return word[0]; + }).join(''); + } }, axisY: { - offset: 20 + offset: 20 } - }, [ +}, [ // Options override for media > 400px ['screen and (min-width: 400px)', { - reverseData: true, - horizontalBars: true, - axisX: { - labelInterpolationFnc: Chartist.noop - }, - axisY: { - offset: 60 - } + reverseData: true, + horizontalBars: true, + axisX: { + labelInterpolationFnc: Chartist.noop + }, + axisY: { + offset: 60 + } }], // Options override for media > 800px ['screen and (min-width: 800px)', { - stackBars: false, - seriesBarDistance: 10 + stackBars: false, + seriesBarDistance: 10 }], // Options override for media > 1000px ['screen and (min-width: 1000px)', { - reverseData: false, - horizontalBars: false, - seriesBarDistance: 15 + reverseData: false, + horizontalBars: false, + seriesBarDistance: 15 }] - ]); +]); new Chartist.Pie('.ct-chart', { - series: [{ - value: 20, - name: 'Series 1', - className: 'my-custom-class-one', - meta: 'Meta One' - }, { - value: 10, - name: 'Series 2', - className: 'my-custom-class-two', - meta: 'Meta Two' + series: [{ + value: 20, + name: 'Series 1', + className: 'my-custom-class-one', + meta: 'Meta One' }, { - value: 70, - name: 'Series 3', - className: 'my-custom-class-three', - meta: 'Meta Three' + value: 10, + name: 'Series 2', + className: 'my-custom-class-two', + meta: 'Meta Two' + }, { + value: 70, + name: 'Series 3', + className: 'my-custom-class-three', + meta: { description: 'Meta Three' } }] }); new Chartist.Bar('.bar-chart', { - labels: ['foo', 'bar', 'foobar'], - series: [ - { - data: [1], - className: 'graph-foo', - }, - { - data: [10], - className: 'graph-foo', - }, - { - data: [12], - className: 'graph-foo', - }] -  }, { + labels: ['foo', 'bar', 'foobar'], + series: [ + { + data: [1], + className: 'graph-foo', + }, + { + data: [10], + className: 'graph-foo', + }, + { + data: [12], + className: 'graph-foo', + }] +}, { seriesBarDistance: 30, reverseData: true, horizontalBars: true, height: '115px', axisY: { - offset: 70, - showGrid: false, + offset: 70, + showGrid: false, }, axisX: { - scaleMinSpace: 200 + scaleMinSpace: 200 } - }); +}); new Chartist.Line('.ct-chart', { - labels: [1, 2, 3, 4, 5, 6, 7, 8], - series: [ - [5, 9, 7, 8, 5, 3, 5, 4] - ] + labels: [1, 2, 3, 4, 5, 6, 7, 8], + series: [ + [5, 9, 7, 8, 5, 3, 5, 4] + ] }, { ticks: [0, 4], low: 0, showArea: true, axisY: { - showLabel: true, - showGrid: false, - ticks: [1, 4], - type: Chartist.FixedScaleAxis + showLabel: true, + showGrid: false, + ticks: [1, 4], + type: Chartist.FixedScaleAxis } - }); +}); new Chartist.Line('.ct-chart', { - labels: [1, 2, 3, 4, 5, 6, 7, 8], - series: [ - [5, 9, 7, 8, 5, 3, 5, 4] - ] + labels: [1, 2, 3, 4, 5, 6, 7, 8], + series: [ + [5, 9, 7, 8, 5, 3, 5, 4] + ] }, { ticks: [0, 4], low: 0, showArea: true, axisX: { - showGrid: false + showGrid: false }, axisY: { - showLabel: true, - showGrid: false, - ticks: [1, 4], - type: Chartist.FixedScaleAxis + showLabel: true, + showGrid: false, + ticks: [1, 4], + type: Chartist.FixedScaleAxis } - }); +}); var chart2 = new Chartist.Line('.ct-chart', { - labels: [1, 2, 3, 4, 5], - series: [ - [12, 9, 7, 8, 5] - ] + labels: [1, 2, 3, 4, 5], + series: [ + [12, 9, 7, 8, 5] + ] }); // Listening for draw events that get emitted by the Chartist chart chart2.on('draw', (data: any) => { - // If the draw event was triggered from drawing a point on the line chart - if (data.type === 'point') { - // We are creating a new path SVG element that draws a triangle around the point coordinates - var triangle = new Chartist.Svg('path', { - d: ['M', - data.x, - data.y - 15, - 'L', - data.x - 15, - data.y + 8, - 'L', - data.x + 15, - data.y + 8, - 'z'].join(' '), - style: 'fill-opacity: 1' - }, 'ct-area'); + // If the draw event was triggered from drawing a point on the line chart + if (data.type === 'point') { + // We are creating a new path SVG element that draws a triangle around the point coordinates + var triangle = new Chartist.Svg('path', { + d: ['M', + data.x, + data.y - 15, + 'L', + data.x - 15, + data.y + 8, + 'L', + data.x + 15, + data.y + 8, + 'z'].join(' '), + style: 'fill-opacity: 1' + }, 'ct-area'); - // 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); - } + // 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); + } }); // Create a simple bi-polar bar chart var biPolarChart = new Chartist.Bar('.ct-chart', { - labels: ['W1', 'W2', 'W3', 'W4', 'W5', 'W6', 'W7', 'W8', 'W9', 'W10'], - series: [ - [1, 2, 4, 8, 6, -2, -1, -4, -6, -2] - ] + labels: ['W1', 'W2', 'W3', 'W4', 'W5', 'W6', 'W7', 'W8', 'W9', 'W10'], + series: [ + [1, 2, 4, 8, 6, -2, -1, -4, -6, -2] + ] }, { high: 10, low: -10, axisX: { - labelInterpolationFnc: (value: any, index: number) => { - return index % 2 === 0 ? value : null; - } + labelInterpolationFnc: (value: any, index: number) => { + return index % 2 === 0 ? value : null; + } } - }); +}); // Listen for draw events on the bar chart biPolarChart.on('draw', (data: any) => { - // If this draw event is of type bar we can use the data to create additional content - if (data.type === 'bar') { - // We use the group element of the current series to append a simple circle with the bar peek coordinates and a circle radius that is depending on the value - data.group.append(new Chartist.Svg('circle', { - cx: data.x2, - cy: data.y2, - r: Math.abs(Chartist.getMultiValue(data.value)) * 2 + 5 - }, 'ct-slice-pie')); - } + // If this draw event is of type bar we can use the data to create additional content + if (data.type === 'bar') { + // We use the group element of the current series to append a simple circle with the bar peek coordinates and a circle radius that is depending on the value + data.group.append(new Chartist.Svg('circle', { + cx: data.x2, + cy: data.y2, + r: Math.abs(Chartist.getMultiValue(data.value)) * 2 + 5 + }, 'ct-slice-pie')); + } }); new Chartist.Bar('.ct-chart', { - labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], - series: [ - [5, 4, 3, 7, 5, 10, 3], - [3, 2, 9, 5, 4, 6, 4] - ] + labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], + series: [ + [5, 4, 3, 7, 5, 10, 3], + [3, 2, 9, 5, 4, 6, 4] + ] }, { axisX: { - // On the x-axis start means top and end means bottom - position: 'start' + // On the x-axis start means top and end means bottom + position: 'start' }, axisY: { - // On the y-axis start means left and end means right - position: 'end' + // On the y-axis start means left and end means right + position: 'end' } - }); +}); new Chartist.Line('.ct-chart', { - labels: [1, 2, 3, 4, 5], - series: [[1, 2, 8, 1, 7]] + labels: [1, 2, 3, 4, 5], + series: [[1, 2, 8, 1, 7]] }, { lineSmooth: Chartist.Interpolation.none({ - fillHoles: false + fillHoles: false }) - }); +}); new Chartist.Line('.ct-chart', { - labels: [1, 2, 3, 4, 5], - series: [[1, 2, 8, 1, 7]] + labels: [1, 2, 3, 4, 5], + series: [[1, 2, 8, 1, 7]] }, { lineSmooth: Chartist.Interpolation.simple({ - divisor: 2, - fillHoles: false + divisor: 2, + fillHoles: false }) - }); +}); new Chartist.Line('.ct-chart', { - labels: [1, 2, 3, 4, 5], - series: [[1, 2, 8, 1, 7]] + labels: [1, 2, 3, 4, 5], + series: [[1, 2, 8, 1, 7]] }, { lineSmooth: Chartist.Interpolation.cardinal({ - tension: 1, - fillHoles: false + tension: 1, + fillHoles: false }) - }); +}); new Chartist.Line('.ct-chart', { - labels: [1, 2, 3, 4, 5], - series: [[1, 2, 8, 1, 7]] + labels: [1, 2, 3, 4, 5], + series: [[1, 2, 8, 1, 7]] }, { lineSmooth: Chartist.Interpolation.step({ - postpone: true, - fillHoles: false + postpone: true, + fillHoles: false }) - }); +}); var overlappingBarsData: Chartist.IChartistData = { - labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], - series: [ - [5, 4, 3, 7, 5, 10, 3, 4, 8, 10, 6, 8], - [3, 2, 9, 5, 4, 6, 4, 6, 7, 8, 7, 4] - ] + labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + series: [ + [5, 4, 3, 7, 5, 10, 3, 4, 8, 10, 6, 8], + [3, 2, 9, 5, 4, 6, 4, 6, 7, 8, 7, 4] + ] }; var overlappingBarsOptions: Chartist.IBarChartOptions = { - seriesBarDistance: 10 + seriesBarDistance: 10 }; var overlappingBarsResponsiveOptions: Array> = [ - ['screen and (max-width: 640px)', { - seriesBarDistance: 5, - axisX: { - labelInterpolationFnc: (value: any) => { - return value[0]; - } - } - }] + ['screen and (max-width: 640px)', { + seriesBarDistance: 5, + axisX: { + labelInterpolationFnc: (value: any) => { + return value[0]; + } + } + }] ]; new Chartist.Bar('.ct-chart', overlappingBarsData, overlappingBarsOptions, overlappingBarsResponsiveOptions); new Chartist.Candle('.ct-chart', { - labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], - series: [ - [5, 4, 3, 7], - [3, 2, 9, 5], - [5, 4, 3, 7], - [3, 2, 9, 5], - [5, 4, 3, 7], - [3, 2, 9, 5], - [3, 2, 9, 5] - ] + labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], + series: [ + [5, 4, 3, 7], + [3, 2, 9, 5], + [5, 4, 3, 7], + [3, 2, 9, 5], + [5, 4, 3, 7], + [3, 2, 9, 5], + [3, 2, 9, 5] + ] }, { - axisX: { - labelOffset: { - x: -10, - y: 0 + axisX: { + labelOffset: { + x: -10, + y: 0 + } + }, + axisY: { + showGrid: false, + labelInterpolationFnc: function (value: any) { + return value + 12000; + } } - }, - axisY: { - showGrid: false, - labelInterpolationFnc: function (value: any) { - return value + 12000; - } - } }); diff --git a/types/chartist/index.d.ts b/types/chartist/index.d.ts index 93918a5eeb..80cc589ee2 100644 --- a/types/chartist/index.d.ts +++ b/types/chartist/index.d.ts @@ -1,703 +1,728 @@ // Type definitions for Chartist v0.9.81 // Project: https://github.com/gionkunz/chartist-js -// Definitions by: Matt Gibbs , Simon Pfeifer , Cassey Lottman +// Definitions by: Matt Gibbs , Simon Pfeifer , Cassey Lottman , Anastasiia Antonova , Sunny Juneja // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace Chartist { - interface ChartistStatic { - - /** - * Precision level used internally in Chartist for rounding. If you require more decimal places you can increase this number. - */ - precision: number; - - /** - * A map with characters to escape for strings to be safely used as attribute values. - */ - escapingMap: IChartistEscapeMap; - - Pie: IChartistPieChart; - Bar: IChartistBarChart; - Line: IChartistLineChart; - Candle: IChartistCandleChart; - - FixedScaleAxis: IFixedScaleAxisStatic; - AutoScaleAxis: IAutoScaleAxisStatic; - StepAxis: IStepAxisStatic; - - Svg: ChartistSvgStatic; - Interpolation: ChartistInterpolationStatic; - - noop: Function; - - alphaNumerate(n: number): string; - extend(target: Object, ...sources: Object[]): Object; - - replaceAll(str: string, subStr: string, newSubStr: string): string; - ensureUnit(value: number, unit: string): string; - quantity(input: string | number): Object; - - query(query: Node | string): Node; - times(length: number): Array; - sum(previous: number, current: number): number; - mapMultiply(factor: number): (num: number) => number; - mapAdd(addend: number): (num: number) => number; - serialMap(arr: Array, cb: Function): Array; - roundWithPrecision(value: number, digits?: number): number; - - getMultiValue(value: any, dimension?: any): number; // this method is not documented, but it is used in the examples - - serialize(data: Object | string | number): string; - deserialize(data: string): Object | string | number; - - createSvg(container: Node, width: string, height: string, className: string): Object; // TODO: Figure out if this is returning a ChartistSVGWrapper or an actual SVGElement - - plugins: any; - } - - interface IChartistEscapeMap { - [Key: string]: string; - } - - interface IResponsiveOptionTuple extends Array { - 0: string; - 1: T; - } - - // these have no other purpose than to help define the types that can be placed on - // a line chart axisX - // in the actual chartist library these are classes that project their options onto - // the parent class - interface IFixedScaleAxisStatic { } - interface IAutoScaleAxisStatic { } - interface IStepAxisStatic { } - - // data formats are not well documented on all the ways they can be passed to the constructors - // this definition gives some intellisense, but does not protect the user from misuse - // TODO: come in and tidy this up and make it fit better - interface IChartistData { - labels?: Array | Array | Array; - series: Array | Array> | Array | Array>; - } - - interface IChartistSeriesData { - name?: string; - value?: number; - data?: Array; - className?: string; - meta?: string; // I assume this could probably be a number as well? - } - - interface IChartistBase { - container: any; - data: IChartistData; - defaultOptions: T; - options: T; - responsiveOptions: Array>; - - // this most likely doesn't need to be exposed to the user - eventEmitter: any; - - supportsForeignObject: boolean; - supportsAnimations: boolean; - resizeListener: any; - - plugins?: Array; // all of these plugins seem to be functions with options, but keeping type any for now - - update(data: Object, options?: T, override?: boolean): void; - detach(): void; - - /** - * Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop. - * - * @method on - * @param event {string} Name of the event. Check the examples for supported events. - * @param handler {Function} The handler function that will be called when an event with the given name was emitted. This function will receive a data argument which contains event data. See the example for more details. - */ - on(event: string, handler: Function): IChartistBase; - - /** - * Use this function to un-register event handlers. If the handler function parameter is omitted all handlers for the given event will be un-registered. - * - * @method off - * @param event {string} Name of the event for which a handler should be removed - * @param handler {Function} The handler function that that was previously used to register a new event handler. This handler will be removed from the event handler list. If this parameter is omitted then all event handlers for the given event are removed from the list. - */ - off(event: string, handler?: Function): IChartistBase; - } - - interface IChartistPieChart extends IChartistBase { - new (target: any, data: IChartistData, options?: IPieChartOptions, responsiveOptions?: Array>): IChartistPieChart; - } - - interface IChartistLineChart extends IChartistBase { - new (target: any, data: IChartistData, options?: ILineChartOptions, responsiveOptions?: Array>): IChartistLineChart; - } - - interface IChartistBarChart extends IChartistBase { - new (target: any, data: IChartistData, options?: IBarChartOptions, responsiveOptions?: Array>): IChartistBarChart; - } - - interface IChartistCandleChart extends IChartistBase { - new (target: any, data: IChartistData, options?: ICandleChartOptions, responsiveOptions?: Array>): IChartistCandleChart; - } - - interface IChartOptions { - /** - * If true the whole data is reversed including labels, the series order as well as the whole series data arrays. - */ - reverseData?: boolean; - - plugins?: Array; - } - - interface IPieChartOptions extends IChartOptions { - /** - * Specify a fixed width for the chart as a string (i.e. '100px' or '50%') - */ - width?: number | string; - - /** - * Specify a fixed height for the chart as a string (i.e. '100px' or '50%') - */ - height?: number | string; - - /** - * Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5} - */ - chartPadding?: IChartPadding | number; - - /** - * Override the class names that are used to generate the SVG structure of the chart - */ - classNames?: IPieChartClasses; - - /** - * The start angle of the pie chart in degrees where 0 points north. A higher value offsets the start angle clockwise. - */ - startAngle?: number; - - /** - * An optional total you can specify. By specifying a total value, the sum of the values in the series must be this total in order to draw a full pie. You can use this parameter to draw only parts of a pie or gauge charts. - */ - total?: number; - - /** - * If specified the donut CSS classes will be used and strokes will be drawn instead of pie slices. - */ - donut?: boolean; - - /** - * If specified the donut segments will be drawn as shapes instead of strokes. - */ - donutSolid?: boolean; - - /** - * Specify the donut stroke width, currently done in javascript for convenience. May move to CSS styles in the future. - * This option can be set as number or string to specify a relative width (i.e. 100 or '30%'). - */ - donutWidth?: number | string; - - /** - * Specify if a label should be shown or not - */ - showLabel?: boolean; - - /** - * Label position offset from the standard position which is half distance of the radius. This value can be either positive or negative. Positive values will position the label away from the center. - */ - labelOffset?: number; - - /** - * This option can be set to 'inside', 'outside' or 'center'. Positioned with 'inside' the labels will be placed on half the distance of the radius to the border of the Pie by respecting the 'labelOffset'. The 'outside' option will place the labels at the border of the pie and 'center' will place the labels in the absolute center point of the chart. The 'center' option only makes sense in conjunction with the 'labelOffset' option. - */ - labelPosition?: string; - - /** - * An interpolation function for the label value - */ - labelInterpolationFnc?: Function; - - /** - * Label direction can be 'neutral', 'explode' or 'implode'. Default is 'neutral'. The labels anchor will be positioned based on those settings as well as the fact if the labels are on the right or left side of the center of the chart. Usually explode is useful when labels are positioned far away from the center. - */ - labelDirection?: string; - - /** - * If true the whole data is reversed including labels, the series order as well as the whole series data arrays. - */ - reverseData?: boolean; - - /** - * If true empty values will be ignored to avoid drawing unncessary slices and labels - */ - ignoreEmptyValues?: boolean; - } - - interface IChartPadding { - top?: number; - right?: number; - bottom?: number; - left?: number; - } - - interface IPieChartClasses { - chartPie?: string; - chartDonut?: string; - series?: string; - slicePie?: string; - sliceDonut?: string; - label?: string; - } - - interface IBarChartOptions extends IChartOptions { - axisX?: IBarChartAxis; - axisY?: IBarChartAxis; - width?: number | string; - height?: number | string; - high?: number; - low?: number; - ticks?: Array; - onlyInteger?: boolean; - chartPadding?: IChartPadding; - seriesBarDistance?: number; - - /** - * If set to true this property will cause the series bars to be stacked and form a total for each series point. This will also influence the y-axis and the overall bounds of the chart. In stacked mode the seriesBarDistance property will have no effect. - */ - stackBars?: boolean; - - horizontalBars?: boolean; - distributeSeries?: boolean; - } - - interface IBarChartAxis { - offset?: number; - position?: string; - labelOffset?: { - x?: number; - y?: number; - }; - showLabel?: boolean; - showGrid?: boolean; - labelInterpolationFnc?: Function; - scaleMinSpace?: number; - onlyInteger?: boolean; - } - - interface IBarChartClasses { - chart?: string; - horizontalBars?: string; - label?: string; - labelGroup?: string; - series?: string; - bar?: string; - grid?: string; - gridGroup?: string; - vertical?: string; - horizontal?: string; - start?: string; - end?: string; - } - - interface ILineChartOptions extends IChartOptions { - axisX?: IChartistStepAxis | IChartistFixedScaleAxis | IChartistAutoScaleAxis; - axisY?: IChartistStepAxis | IChartistFixedScaleAxis | IChartistAutoScaleAxis; - width?: number | string; - height?: number | string; - showLine?: boolean; - showPoint?: boolean; - showArea?: boolean; - areaBase?: number; - lineSmooth?: Function | boolean; - low?: number; - high?: number; - ticks?: Array; - chartPadding?: IChartPadding; - fullWidth?: boolean; - classNames?: ILineChartClasses; - } - - interface ILineChartAxis { - offset?: number; - position?: string; - labelOffset?: { - x?: number; - y?: number; - }; - showLabel?: boolean; - showGrid?: boolean; - labelInterpolationFnc?: Function; - } - - interface IChartistStepAxis extends ILineChartAxis { - type?: IStepAxisStatic; - ticks?: Array | Array; - stretch?: boolean; - } - - interface IChartistFixedScaleAxis extends ILineChartAxis { - type?: IFixedScaleAxisStatic; - high?: number; - low?: number; - divisor?: number; - ticks?: Array | Array; - } - - interface IChartistAutoScaleAxis extends ILineChartAxis { - high?: number; - low?: number; - scaleMinSpace?: number; - onlyInteger?: boolean; - referenceValue?: number; - type?: IAutoScaleAxisStatic; - } - - interface ILineChartClasses { - /** - * Default is 'ct-chart-line' - */ - chart?: string; - label?: string; - labelGroup?: string; - series?: string; - line?: string; - point?: string; - area?: string; - grid?: string; - gridGroup?: string; - gridBackground?: string; - vertical?: string; - horizontal?: string; - start?: string; - end?: string; - } - - interface ICandleChartOptions extends IChartOptions { - - /** - * Options for X-Axis - */ - axisX?: ICandleChartAxis; - - /** - * Options for Y-Axis - */ - axisY?: ICandleChartAxis; - - /** - * Specify a fixed width for the chart as a string (i.e. '100px' or '50%') - */ - width?: number | string; - - /** - * Specify a fixed height for the chart as a string (i.e. '100px' or '50%') - */ - height?: number | string; - - /** - * Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value - */ - hight?: number | string; - - /** - * Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value - */ - low?: number | string; - - /** - * Width of candle body in pixel (IMO is 2 px best minimum value) - */ - candleWidth?: number | string; - - /** - * Width of candle wick in pixel (IMO is 1 px best minimum value) - */ - candleWickWidth?: number | string; - - /** - * Use calculated x-axis step length, depending on the number of quotes to display, as candle width. Otherwise the candleWidth is being used. - */ - useStepLengthAsCandleWidth?: boolean | string; - - /** - * Use 1/3 of candle body width as width for the candle wick, otherwise the candleWickWidth is being used. - */ - useOneThirdAsCandleWickWidth?: boolean | string; - - /** - * Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5} - */ - chartPadding?: IChartPadding | number; - - /** - * When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawncorrectly you might need to add chart padding or offset the last label with a draw event handler. - */ - fullWidth?: boolean | string; - - /** - * Override the class names that get used to generate the SVG structure of the chart - */ - classNames?: ICandleChartClasses; - } - - interface ICandleChartAxis { - /** - * The offset of the chart drawing area to the border of the container - */ - offset?: number; - /** - * Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. - */ - position?: string; - /** - * Allows you to correct label positioning on this axis by positive or negative x and y offset. - */ - labelOffset?: { - x?: number; - y?: number; - }; - /** - * If labels should be shown or not - */ - showLabel?: boolean; - /** - * If the axis grid should be drawn or not - */ - showGrid?: boolean; - /** - * Interpolation function that allows you to intercept the value from the axis label - */ - labelInterpolationFnc?: Function; - /** - * Set the axis type to be used to project values on this axis. If not defined, Chartist.StepAxis will be used for the X-Axis, where the ticks option will be set to the labels in the data and the stretch option will be set to the global fullWidth option. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here. - */ - type?: any; - } - - interface ICandleChartClasses { - chart?: string; - label?: string; - labelGroup?: string; - series?: string; - candlePositive?: string; - candleNegative?: string, - grid?: string, - gridGroup?: string, - gridBackground?: string, - vertical?: string, - horizontal?: string, - start?: string, - end?: string, - } - - - interface ChartistSvgStatic { - new (name: HTMLElement | string, attributes: Object, className?: string, parent?: Object, insertFirst?: boolean): IChartistSvg; - - Easing: ChartistEasingStatic; - - /** - * This method checks for support of a given SVG feature like Extensibility, SVG-animation or the like. Check http://www.w3.org/TR/SVG11/feature for a detailed list. - */ - isSupported(feature: string): boolean; - } - - interface IChartistSvg { - - /** - * Set attributes on the current SVG element of the wrapper you're currently working on. - */ - 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. - */ - elem(name: string, attributes?: Object, className?: string, insertFirst?: boolean): IChartistSvg; - - /** - * Returns the parent Chartist.SVG wrapper object - */ - parent(): IChartistSvg; - - /** - * This method returns a Chartist.Svg wrapper around the root SVG element of the current tree. - */ - root(): IChartistSvg; - - /** - * Find the first child SVG element of the current element that matches a CSS selector. The returned object is a Chartist.Svg wrapper. - */ - querySelector(selector: string): IChartistSvg; - - /** - * Find the all child SVG elements of the current element that match a CSS selector. The returned object is a Chartist.Svg.List wrapper. - */ - querySelectorAll(selector: string): any; // this returns an svg wrapper list in the docs, need to see if that's just an array or a special list - - /** - * This method creates a foreignObject (see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject) that allows to embed HTML content into a SVG graphic. With the help of foreignObjects you can enable the usage of regular HTML elements inside of SVG where they are subject for SVG positioning and transformation but the Browser will use the HTML rendering capabilities for the containing DOM. - */ - foreignObject(content: any, attributes?: Object, className?: string, insertFirst?: boolean): IChartistSvg; - - /** - * This method adds a new text element to the current Chartist.Svg wrapper. - */ - text(t: string): IChartistSvg; - - /** - * This method will clear all child nodes of the current wrapper object. - */ - empty(): IChartistSvg; - - /** - * This method will cause the current wrapper to remove itself from its parent wrapper. Use this method if you'd like to get rid of an element in a given DOM structure. - */ - remove(): IChartistSvg; - - /** - * This method will replace the element with a new element that can be created outside of the current DOM. - */ - replace(): IChartistSvg; - - /** - * This method will append an element to the current element as a child. - */ - append(element: IChartistSvg, insertFirst?: boolean): IChartistSvg; - - /** - * Returns an array of class names that are attached to the current wrapper element. This method can not be chained further. - */ - classes(): Array; - - /** - * Adds one or a space separated list of classes to the current element and ensures the classes are only existing once. - * - * @method addClass - * @param names {string} A white space separated list of class names - */ - addClass(names: string): IChartistSvg; - - /** - * Removes one or a space separated list of classes from the current element. - * - * @method removeClass - * @param names {string} A white space separated list of class names - */ - removeClass(names: string): IChartistSvg; - - /** - * Removes all classes from the current element. - */ - removeAllClasses(): IChartistSvg; - - /** - * Get element height with fallback to svg BoundingBox or parent container dimensions - */ - height(): number; - - /** - * The animate function lets you animate the current element with SMIL animations. You can add animations for multiple attributes at the same time by using an animation definition object. This object should contain SMIL animation attributes. - */ - animate(animations: IChartistAnimations, guided: boolean, eventEmitter: Object): IChartistSvg; - - /** - * "Safe" way to get property value from svg BoundingBox. This is a workaround. Firefox throws an NS_ERROR_FAILURE error if getBBox() is called on an invisible node. - * THIS IS A WORKAROUND - */ - getBBoxProperty(node: SVGElement, prop: string): string; // TODO: find a good example of this and add it to the tests, it might belong to static - } - - interface IChartistAnimations { - [Key: string]: IChartistAnimationOptions; - } - - interface IChartistAnimationOptions { - id?: string; - dur: string | number; - from: string | number; - to: string | number; - easing?: IChartistEasingDefinition | string; - fill?: string; - begin?: string; - } - - interface IChartistEasingDefinition { - 0: number; - 1: number; - 2: number; - 3: number; - } - - interface ChartistEasingStatic { - easeInSine: IChartistEasingDefinition; - easeOutSine: IChartistEasingDefinition; - easeInOutSine: IChartistEasingDefinition; - easeInQuad: IChartistEasingDefinition; - easeOutQuad: IChartistEasingDefinition; - easeInOutQuad: IChartistEasingDefinition; - easeInCubic: IChartistEasingDefinition; - easeOutCubic: IChartistEasingDefinition; - easeInOutCubic: IChartistEasingDefinition; - easeInQuart: IChartistEasingDefinition; - easeOutQuart: IChartistEasingDefinition; - easeInOutQuart: IChartistEasingDefinition; - easeInQuint: IChartistEasingDefinition; - easeOutQuint: IChartistEasingDefinition; - easeInOutQuint: IChartistEasingDefinition; - easeInExpo: IChartistEasingDefinition; - easeOutExpo: IChartistEasingDefinition; - easeInOutExpo: IChartistEasingDefinition; - easeInCirc: IChartistEasingDefinition; - easeOutCirc: IChartistEasingDefinition; - easeInOutCirc: IChartistEasingDefinition; - easeInBack: IChartistEasingDefinition; - easeOutBack: IChartistEasingDefinition; - easeInOutBack: IChartistEasingDefinition; - } - - interface ChartistInterpolationStatic { - - /** - * This interpolation function does not smooth the path and the result is only containing lines and no curves. - */ - none(options?: IChartistInterpolationOptions): Function; - - /** - * Simple smoothing creates horizontal handles that are positioned with a fraction of the length between two data points. You can use the divisor option to specify the amount of smoothing. - */ - simple(options?: IChartistSimpleInterpolationOptions): Function; - - /** - * Cardinal / Catmull-Rome spline interpolation is the default smoothing function in Chartist. It produces nice results where the splines will always meet the points. It produces some artifacts though when data values are increased or decreased rapidly. The line may not follow a very accurate path and if the line should be accurate this smoothing function does not produce the best results. - */ - cardinal(options?: IChartistCardinalInterpolationOptions): Function; - - /** - * Step interpolation will cause the line chart to move in steps rather than diagonal or smoothed lines. This interpolation will create additional points that will also be drawn when the showPoint option is enabled. - */ - step(options?: IChartistStepInterpolationOptions): Function; - } - - interface IChartistInterpolationOptions { - fillHoles?: boolean; - } - - interface IChartistSimpleInterpolationOptions extends IChartistInterpolationOptions { - divisor?: number; - } - - interface IChartistCardinalInterpolationOptions extends IChartistInterpolationOptions { - tension?: number; - } - - interface IChartistStepInterpolationOptions extends IChartistInterpolationOptions { - postpone?: boolean; - } + interface ChartistStatic { + + /** + * Precision level used internally in Chartist for rounding. If you require more decimal places you can increase this number. + */ + precision: number; + + /** + * A map with characters to escape for strings to be safely used as attribute values. + */ + escapingMap: IChartistEscapeMap; + + Pie: IChartistPieChart; + Bar: IChartistBarChart; + Line: IChartistLineChart; + Candle: IChartistCandleChart; + + FixedScaleAxis: IFixedScaleAxisStatic; + AutoScaleAxis: IAutoScaleAxisStatic; + StepAxis: IStepAxisStatic; + + Svg: ChartistSvgStatic; + Interpolation: ChartistInterpolationStatic; + + noop: Function; + + alphaNumerate(n: number): string; + + extend(target: Object, ...sources: Object[]): Object; + + replaceAll(str: string, subStr: string, newSubStr: string): string; + + ensureUnit(value: number, unit: string): string; + + quantity(input: string | number): Object; + + query(query: Node | string): Node; + + times(length: number): Array; + + sum(previous: number, current: number): number; + + mapMultiply(factor: number): (num: number) => number; + + mapAdd(addend: number): (num: number) => number; + + serialMap(arr: Array, cb: Function): Array; + + roundWithPrecision(value: number, digits?: number): number; + + getMultiValue(value: any, dimension?: any): number; // this method is not documented, but it is used in the examples + + serialize(data: Object | string | number): string; + + deserialize(data: string): Object | string | number; + + createSvg(container: Node, width: string, height: string, className: string): Object; // TODO: Figure out if this is returning a ChartistSVGWrapper or an actual SVGElement + + plugins: any; + } + + interface IChartistEscapeMap { + [Key: string]: string; + } + + interface IResponsiveOptionTuple extends Array { + 0: string; + 1: T; + } + + // these have no other purpose than to help define the types that can be placed on + // a line chart axisX + // in the actual chartist library these are classes that project their options onto + // the parent class + interface IFixedScaleAxisStatic { + } + + interface IAutoScaleAxisStatic { + } + + interface IStepAxisStatic { + } + + // data formats are not well documented on all the ways they can be passed to the constructors + // this definition gives some intellisense, but does not protect the user from misuse + // TODO: come in and tidy this up and make it fit better + interface IChartistData { + labels?: Array | Array | Array; + series: Array | Array> | Array | Array>; + } + + interface IChartistSeriesData { + name?: string; + value?: number; + data?: Array; + className?: string; + meta?: any; + } + + interface IChartistBase { + container: any; + data: IChartistData; + defaultOptions: T; + options: T; + responsiveOptions: Array>; + + // this most likely doesn't need to be exposed to the user + eventEmitter: any; + + supportsForeignObject: boolean; + supportsAnimations: boolean; + resizeListener: any; + + plugins?: Array; // all of these plugins seem to be functions with options, but keeping type any for now + + update(data: Object, options?: T, override?: boolean): void; + + detach(): void; + + /** + * Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop. + * + * @method on + * @param event {string} Name of the event. Check the examples for supported events. + * @param handler {Function} The handler function that will be called when an event with the given name was emitted. This function will receive a data argument which contains event data. See the example for more details. + */ + on(event: string, handler: Function): IChartistBase; + + /** + * Use this function to un-register event handlers. If the handler function parameter is omitted all handlers for the given event will be un-registered. + * + * @method off + * @param event {string} Name of the event for which a handler should be removed + * @param handler {Function} The handler function that that was previously used to register a new event handler. This handler will be removed from the event handler list. If this parameter is omitted then all event handlers for the given event are removed from the list. + */ + off(event: string, handler?: Function): IChartistBase; + } + + interface IChartistPieChart extends IChartistBase { + new (target: any, data: IChartistData, options?: IPieChartOptions, responsiveOptions?: Array>): IChartistPieChart; + } + + interface IChartistLineChart extends IChartistBase { + new (target: any, data: IChartistData, options?: ILineChartOptions, responsiveOptions?: Array>): IChartistLineChart; + } + + interface IChartistBarChart extends IChartistBase { + new (target: any, data: IChartistData, options?: IBarChartOptions, responsiveOptions?: Array>): IChartistBarChart; + } + + interface IChartistCandleChart extends IChartistBase { + new (target: any, data: IChartistData, options?: ICandleChartOptions, responsiveOptions?: Array>): IChartistCandleChart; + } + + interface IChartOptions { + /** + * If true the whole data is reversed including labels, the series order as well as the whole series data arrays. + */ + reverseData?: boolean; + + plugins?: Array; + } + + interface IPieChartOptions extends IChartOptions { + /** + * Specify a fixed width for the chart as a string (i.e. '100px' or '50%') + */ + width?: number | string; + + /** + * Specify a fixed height for the chart as a string (i.e. '100px' or '50%') + */ + height?: number | string; + + /** + * Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5} + */ + chartPadding?: IChartPadding | number; + + /** + * Override the class names that are used to generate the SVG structure of the chart + */ + classNames?: IPieChartClasses; + + /** + * The start angle of the pie chart in degrees where 0 points north. A higher value offsets the start angle clockwise. + */ + startAngle?: number; + + /** + * An optional total you can specify. By specifying a total value, the sum of the values in the series must be this total in order to draw a full pie. You can use this parameter to draw only parts of a pie or gauge charts. + */ + total?: number; + + /** + * If specified the donut CSS classes will be used and strokes will be drawn instead of pie slices. + */ + donut?: boolean; + + /** + * If specified the donut segments will be drawn as shapes instead of strokes. + */ + donutSolid?: boolean; + + /** + * Specify the donut stroke width, currently done in javascript for convenience. May move to CSS styles in the future. + * This option can be set as number or string to specify a relative width (i.e. 100 or '30%'). + */ + donutWidth?: number | string; + + /** + * Specify if a label should be shown or not + */ + showLabel?: boolean; + + /** + * Label position offset from the standard position which is half distance of the radius. This value can be either positive or negative. Positive values will position the label away from the center. + */ + labelOffset?: number; + + /** + * This option can be set to 'inside', 'outside' or 'center'. Positioned with 'inside' the labels will be placed on half the distance of the radius to the border of the Pie by respecting the 'labelOffset'. The 'outside' option will place the labels at the border of the pie and 'center' will place the labels in the absolute center point of the chart. The 'center' option only makes sense in conjunction with the 'labelOffset' option. + */ + labelPosition?: string; + + /** + * An interpolation function for the label value + */ + labelInterpolationFnc?: Function; + + /** + * Label direction can be 'neutral', 'explode' or 'implode'. Default is 'neutral'. The labels anchor will be positioned based on those settings as well as the fact if the labels are on the right or left side of the center of the chart. Usually explode is useful when labels are positioned far away from the center. + */ + labelDirection?: string; + + /** + * If true the whole data is reversed including labels, the series order as well as the whole series data arrays. + */ + reverseData?: boolean; + + /** + * If true empty values will be ignored to avoid drawing unncessary slices and labels + */ + ignoreEmptyValues?: boolean; + } + + interface IChartPadding { + top?: number; + right?: number; + bottom?: number; + left?: number; + } + + interface IPieChartClasses { + chartPie?: string; + chartDonut?: string; + series?: string; + slicePie?: string; + sliceDonut?: string; + label?: string; + } + + interface IBarChartOptions extends IChartOptions { + axisX?: IBarChartAxis; + axisY?: IBarChartAxis; + width?: number | string; + height?: number | string; + high?: number; + low?: number; + ticks?: Array; + onlyInteger?: boolean; + chartPadding?: IChartPadding; + seriesBarDistance?: number; + + /** + * If set to true this property will cause the series bars to be stacked and form a total for each series point. This will also influence the y-axis and the overall bounds of the chart. In stacked mode the seriesBarDistance property will have no effect. + */ + stackBars?: boolean; + + horizontalBars?: boolean; + distributeSeries?: boolean; + } + + interface IBarChartAxis { + offset?: number; + position?: string; + labelOffset?: { + x?: number; + y?: number; + }; + showLabel?: boolean; + showGrid?: boolean; + labelInterpolationFnc?: Function; + scaleMinSpace?: number; + onlyInteger?: boolean; + } + + interface IBarChartClasses { + chart?: string; + horizontalBars?: string; + label?: string; + labelGroup?: string; + series?: string; + bar?: string; + grid?: string; + gridGroup?: string; + vertical?: string; + horizontal?: string; + start?: string; + end?: string; + } + + interface ILineChartOptions extends IChartOptions { + axisX?: IChartistStepAxis | IChartistFixedScaleAxis | IChartistAutoScaleAxis; + axisY?: IChartistStepAxis | IChartistFixedScaleAxis | IChartistAutoScaleAxis; + width?: number | string; + height?: number | string; + showLine?: boolean; + showPoint?: boolean; + showArea?: boolean; + areaBase?: number; + lineSmooth?: Function | boolean; + low?: number; + high?: number; + ticks?: Array; + chartPadding?: IChartPadding; + fullWidth?: boolean; + classNames?: ILineChartClasses; + series?: { + [key: string]: { + lineSmooth?: Function | boolean; + showLine?: boolean; + showPoint?: boolean; + showArea?: boolean; + areaBase?: number; + } + } + } + + interface ILineChartAxis { + offset?: number; + position?: string; + labelOffset?: { + x?: number; + y?: number; + }; + showLabel?: boolean; + showGrid?: boolean; + labelInterpolationFnc?: Function; + } + + interface IChartistStepAxis extends ILineChartAxis { + type?: IStepAxisStatic; + ticks?: Array | Array; + stretch?: boolean; + } + + interface IChartistFixedScaleAxis extends ILineChartAxis { + type?: IFixedScaleAxisStatic; + high?: number; + low?: number; + divisor?: number; + ticks?: Array | Array; + } + + interface IChartistAutoScaleAxis extends ILineChartAxis { + high?: number; + low?: number; + scaleMinSpace?: number; + onlyInteger?: boolean; + referenceValue?: number; + type?: IAutoScaleAxisStatic; + } + + interface ILineChartClasses { + /** + * Default is 'ct-chart-line' + */ + chart?: string; + label?: string; + labelGroup?: string; + series?: string; + line?: string; + point?: string; + area?: string; + grid?: string; + gridGroup?: string; + gridBackground?: string; + vertical?: string; + horizontal?: string; + start?: string; + end?: string; + } + + interface ICandleChartOptions extends IChartOptions { + + /** + * Options for X-Axis + */ + axisX?: ICandleChartAxis; + + /** + * Options for Y-Axis + */ + axisY?: ICandleChartAxis; + + /** + * Specify a fixed width for the chart as a string (i.e. '100px' or '50%') + */ + width?: number | string; + + /** + * Specify a fixed height for the chart as a string (i.e. '100px' or '50%') + */ + height?: number | string; + + /** + * Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value + */ + hight?: number | string; + + /** + * Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value + */ + low?: number | string; + + /** + * Width of candle body in pixel (IMO is 2 px best minimum value) + */ + candleWidth?: number | string; + + /** + * Width of candle wick in pixel (IMO is 1 px best minimum value) + */ + candleWickWidth?: number | string; + + /** + * Use calculated x-axis step length, depending on the number of quotes to display, as candle width. Otherwise the candleWidth is being used. + */ + useStepLengthAsCandleWidth?: boolean | string; + + /** + * Use 1/3 of candle body width as width for the candle wick, otherwise the candleWickWidth is being used. + */ + useOneThirdAsCandleWickWidth?: boolean | string; + + /** + * Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5} + */ + chartPadding?: IChartPadding | number; + + /** + * When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawncorrectly you might need to add chart padding or offset the last label with a draw event handler. + */ + fullWidth?: boolean | string; + + /** + * Override the class names that get used to generate the SVG structure of the chart + */ + classNames?: ICandleChartClasses; + } + + interface ICandleChartAxis { + /** + * The offset of the chart drawing area to the border of the container + */ + offset?: number; + /** + * Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis. + */ + position?: string; + /** + * Allows you to correct label positioning on this axis by positive or negative x and y offset. + */ + labelOffset?: { + x?: number; + y?: number; + }; + /** + * If labels should be shown or not + */ + showLabel?: boolean; + /** + * If the axis grid should be drawn or not + */ + showGrid?: boolean; + /** + * Interpolation function that allows you to intercept the value from the axis label + */ + labelInterpolationFnc?: Function; + /** + * Set the axis type to be used to project values on this axis. If not defined, Chartist.StepAxis will be used for the X-Axis, where the ticks option will be set to the labels in the data and the stretch option will be set to the global fullWidth option. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here. + */ + type?: any; + } + + interface ICandleChartClasses { + chart?: string; + label?: string; + labelGroup?: string; + series?: string; + candlePositive?: string; + candleNegative?: string, + grid?: string, + gridGroup?: string, + gridBackground?: string, + vertical?: string, + horizontal?: string, + start?: string, + end?: string, + } + + + interface ChartistSvgStatic { + new (name?: HTMLElement | string, attributes?: Object, className?: string, parent?: Object, insertFirst?: boolean): IChartistSvg; + + Easing: ChartistEasingStatic; + + /** + * This method checks for support of a given SVG feature like Extensibility, SVG-animation or the like. Check http://www.w3.org/TR/SVG11/feature for a detailed list. + */ + isSupported(feature: string): boolean; + } + + interface IChartistSvg { + + /** + * Set attributes on the current SVG element of the wrapper you're currently working on. + */ + 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. + */ + elem(name: string, attributes?: Object, className?: string, insertFirst?: boolean): IChartistSvg; + + /** + * Returns the parent Chartist.SVG wrapper object + */ + parent(): IChartistSvg; + + /** + * This method returns a Chartist.Svg wrapper around the root SVG element of the current tree. + */ + root(): IChartistSvg; + + /** + * Find the first child SVG element of the current element that matches a CSS selector. The returned object is a Chartist.Svg wrapper. + */ + querySelector(selector: string): IChartistSvg; + + /** + * Find the all child SVG elements of the current element that match a CSS selector. The returned object is a Chartist.Svg.List wrapper. + */ + querySelectorAll(selector: string): any; // this returns an svg wrapper list in the docs, need to see if that's just an array or a special list + + /** + * This method creates a foreignObject (see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject) that allows to embed HTML content into a SVG graphic. With the help of foreignObjects you can enable the usage of regular HTML elements inside of SVG where they are subject for SVG positioning and transformation but the Browser will use the HTML rendering capabilities for the containing DOM. + */ + foreignObject(content: any, attributes?: Object, className?: string, insertFirst?: boolean): IChartistSvg; + + /** + * This method adds a new text element to the current Chartist.Svg wrapper. + */ + text(t: string): IChartistSvg; + + /** + * This method will clear all child nodes of the current wrapper object. + */ + empty(): IChartistSvg; + + /** + * This method will cause the current wrapper to remove itself from its parent wrapper. Use this method if you'd like to get rid of an element in a given DOM structure. + */ + remove(): IChartistSvg; + + /** + * This method will replace the element with a new element that can be created outside of the current DOM. + */ + replace(): IChartistSvg; + + /** + * This method will append an element to the current element as a child. + */ + append(element: IChartistSvg, insertFirst?: boolean): IChartistSvg; + + /** + * Returns an array of class names that are attached to the current wrapper element. This method can not be chained further. + */ + classes(): Array; + + /** + * Adds one or a space separated list of classes to the current element and ensures the classes are only existing once. + * + * @method addClass + * @param names {string} A white space separated list of class names + */ + addClass(names: string): IChartistSvg; + + /** + * Removes one or a space separated list of classes from the current element. + * + * @method removeClass + * @param names {string} A white space separated list of class names + */ + removeClass(names: string): IChartistSvg; + + /** + * Removes all classes from the current element. + */ + removeAllClasses(): IChartistSvg; + + /** + * Get element height with fallback to svg BoundingBox or parent container dimensions + */ + height(): number; + + /** + * The animate function lets you animate the current element with SMIL animations. You can add animations for multiple attributes at the same time by using an animation definition object. This object should contain SMIL animation attributes. + */ + animate(animations: IChartistAnimations, guided: boolean, eventEmitter: Object): IChartistSvg; + + /** + * "Safe" way to get property value from svg BoundingBox. This is a workaround. Firefox throws an NS_ERROR_FAILURE error if getBBox() is called on an invisible node. + * THIS IS A WORKAROUND + */ + getBBoxProperty(node: SVGElement, prop: string): string; // TODO: find a good example of this and add it to the tests, it might belong to static + } + + interface IChartistAnimations { + [Key: string]: IChartistAnimationOptions; + } + + interface IChartistAnimationOptions { + id?: string; + dur: string | number; + from: string | number; + to: string | number; + easing?: IChartistEasingDefinition | string; + fill?: string; + begin?: string; + } + + interface IChartistEasingDefinition { + 0: number; + 1: number; + 2: number; + 3: number; + } + + interface ChartistEasingStatic { + easeInSine: IChartistEasingDefinition; + easeOutSine: IChartistEasingDefinition; + easeInOutSine: IChartistEasingDefinition; + easeInQuad: IChartistEasingDefinition; + easeOutQuad: IChartistEasingDefinition; + easeInOutQuad: IChartistEasingDefinition; + easeInCubic: IChartistEasingDefinition; + easeOutCubic: IChartistEasingDefinition; + easeInOutCubic: IChartistEasingDefinition; + easeInQuart: IChartistEasingDefinition; + easeOutQuart: IChartistEasingDefinition; + easeInOutQuart: IChartistEasingDefinition; + easeInQuint: IChartistEasingDefinition; + easeOutQuint: IChartistEasingDefinition; + easeInOutQuint: IChartistEasingDefinition; + easeInExpo: IChartistEasingDefinition; + easeOutExpo: IChartistEasingDefinition; + easeInOutExpo: IChartistEasingDefinition; + easeInCirc: IChartistEasingDefinition; + easeOutCirc: IChartistEasingDefinition; + easeInOutCirc: IChartistEasingDefinition; + easeInBack: IChartistEasingDefinition; + easeOutBack: IChartistEasingDefinition; + easeInOutBack: IChartistEasingDefinition; + } + + interface ChartistInterpolationStatic { + + /** + * This interpolation function does not smooth the path and the result is only containing lines and no curves. + */ + none(options?: IChartistInterpolationOptions): Function; + + /** + * Simple smoothing creates horizontal handles that are positioned with a fraction of the length between two data points. You can use the divisor option to specify the amount of smoothing. + */ + simple(options?: IChartistSimpleInterpolationOptions): Function; + + /** + * Cardinal / Catmull-Rome spline interpolation is the default smoothing function in Chartist. It produces nice results where the splines will always meet the points. It produces some artifacts though when data values are increased or decreased rapidly. The line may not follow a very accurate path and if the line should be accurate this smoothing function does not produce the best results. + */ + cardinal(options?: IChartistCardinalInterpolationOptions): Function; + + /** + * Step interpolation will cause the line chart to move in steps rather than diagonal or smoothed lines. This interpolation will create additional points that will also be drawn when the showPoint option is enabled. + */ + step(options?: IChartistStepInterpolationOptions): Function; + } + + interface IChartistInterpolationOptions { + fillHoles?: boolean; + } + + interface IChartistSimpleInterpolationOptions extends IChartistInterpolationOptions { + divisor?: number; + } + + interface IChartistCardinalInterpolationOptions extends IChartistInterpolationOptions { + tension?: number; + } + + interface IChartistStepInterpolationOptions extends IChartistInterpolationOptions { + postpone?: boolean; + } } declare var Chartist: Chartist.ChartistStatic; export = Chartist; -export as namespace Chartist; \ No newline at end of file +export as namespace Chartist; diff --git a/types/chroma-js/index.d.ts b/types/chroma-js/index.d.ts index 797752c8ad..daf53a0e10 100644 --- a/types/chroma-js/index.d.ts +++ b/types/chroma-js/index.d.ts @@ -293,6 +293,8 @@ declare namespace chroma { mode(mode: keyof ColorSpaces): this; + gamma(g: number): this; + cache(use: boolean): boolean; correctLightness(enable?: boolean): this; diff --git a/types/chrome-apps/index.d.ts b/types/chrome-apps/index.d.ts new file mode 100644 index 0000000000..957c409a4f --- /dev/null +++ b/types/chrome-apps/index.d.ts @@ -0,0 +1,5781 @@ +// 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: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +/////////////// +// 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 { + namespace accessibilityFeatures { + interface AccessibilityFeaturesGetArg { + /** Optional. Whether to return the value that applies to the incognito session (default false). */ + incognito?: boolean; + } + + interface AccessibilityFeaturesCallbackArg { + /** The value of the setting. */ + value: any; + /** + * One of + * • not_controllable: cannot be controlled by any extension + * • controlled_by_other_extensions: controlled by extensions with higher precedence + * • 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. */ + incognitoSpecific?: boolean; + } + + interface AccessibilityFeaturesSetArg { + /** + * The value of the setting. + * Note that every setting has a specific value type, which is described together with the setting. An extension should not set a value of a different type. + */ + value: any; + /** + * Optional. + * 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; + } + + interface AccessibilityFeaturesClearArg { + /** + * Optional. + * 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; + } + + interface AccessibilityFeaturesSetting { + /** + * Gets the value of a setting. + * @param details Which setting to consider. + * @param callback The callback parameter should be a function that looks like this: + * function(object details) {...}; + */ + get(details: AccessibilityFeaturesGetArg, callback: (details: AccessibilityFeaturesCallbackArg) => void): void; + /** + * Sets the value of a setting. + * @param details Which setting to change. + * @param callback Called at the completion of the set operation. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + set(details: AccessibilityFeaturesSetArg, callback?: () => void): void; + /** + * Clears the setting, restoring any default value. + * @param details Which setting to clear. + * @param callback Called at the completion of the clear operation. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + 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; + } + + //////////////////// + // 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" + */ + namespace alarms { + interface AlarmCreateInfo { + /** Optional. 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. */ + periodInMinutes?: number; + /** Optional. 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. */ + 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; + /** Name of this alarm. */ + name: string; + } + + interface AlarmEvent extends chrome.events.Event<(alarm: Alarm) => 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. + * 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; + /** + * 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; + /** + * 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) {...}; + */ + export 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) {...}; + */ + export 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) {...}; + */ + export 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) {...}; + */ + export 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) {...}; + */ + export 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) {...}; + */ + export function get(name: string, callback: (alarm: Alarm) => void): void; + + /** Fired when an alarm has elapsed. Useful for event pages. */ + export var onAlarm: AlarmEvent; + } + + + //////////////////// + // App + //////////////////// + namespace app { + interface AppDetails extends chrome.runtime.Manifest { + id: string; + } + + export function getDetails(): AppDetails; + } + + //////////////////// + // 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'; + + interface LaunchData { + id?: string; + items?: LaunchDataItem[]; + url?: string; + referrerUrl?: string; + isKioskSession?: boolean; + isPublicSession?: boolean; + source?: LaunchSource; + actionData?: {}; + } + + interface LaunchDataItem { + entry: FileEntry; + 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; + } + + //////////////////// + // App Window + //////////////////// + namespace app.window { + interface ContentBounds { + left?: number; + top?: number; + width?: number; + height?: number; + } + + interface BoundsSpecification { + left?: number; + top?: number; + width?: number; + height?: number; + minWidth?: number; + minHeight?: number; + maxWidth?: number; + maxHeight?: number; + } + + interface Bounds { + left: number; + top: number; + width: number; + height: number; + minWidth?: number; + minHeight?: number; + maxWidth?: number; + maxHeight?: number; + setPosition(left: number, top: number): void; + setSize(width: number, height: number): void; + setMinimumSize(minWidth: number, minHeight: number): void; + setMaximumSize(maxWidth: number, maxHeight: number): void; + } + interface FrameOptions { + type?: string; + color?: string; + activeColor?: string; + inactiveColor?: string; + } + + interface CreateWindowOptions { + id?: string; + innerBounds?: BoundsSpecification; + outerBounds?: BoundsSpecification; + minWidth?: number; + minHeight?: number; + maxWidth?: number; + maxHeight?: number; + /** + * @description + * @type {(string | FrameOptions)} string ("none", "chrome") or FrameOptions + * @memberof CreateWindowOptions + */ + frame?: string | FrameOptions; + bounds?: ContentBounds; + alphaEnabled?: boolean; + /** + * @description + * @type {string} "normal", "fullscreen", "maximized", "minimized" + * @memberof CreateWindowOptions + */ + state?: string; + hidden?: boolean; + resizable?: boolean; + singleton?: boolean; + alwaysOnTop?: boolean; + focused?: boolean; + visibleOnAllWorkspaces?: boolean; + } + + interface AppWindow { + focus: () => void; + fullscreen: () => void; + isFullscreen: () => boolean; + minimize: () => void; + isMinimized: () => boolean; + maximize: () => void; + isMaximized: () => boolean; + restore: () => void; + moveTo: (left: number, top: number) => void; + resizeTo: (width: number, height: number) => void; + drawAttention: () => void; + clearAttention: () => void; + close: () => void; + show: () => void; + hide: () => void; + getBounds: () => ContentBounds; + setBounds: (bounds: ContentBounds) => void; + isAlwaysOnTop: () => boolean; + setAlwaysOnTop: (alwaysOnTop: boolean) => void; + setVisibleOnAllWorkspaces: (alwaysVisible: boolean) => void; + contentWindow: Window; + id: string; + innerBounds: Bounds; + outerBounds: Bounds; + onBoundsChanged: WindowEvent; + onClosed: WindowEvent; + onFullscreened: WindowEvent; + onMaximized: WindowEvent; + onMinimized: WindowEvent; + 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; + } + + + //////////////////// + // 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 + */ + namespace audio { + export type StreamType = 'INPUT' | 'OUTPUT'; + 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"). */ + displayName: string; + /** Device name. */ + deviceName: string; + /** True if this is the current active device. */ + isActive: boolean; + /** The sound level of the device, volume for output, gain for input. */ + level: number; + /** The stable/persisted device id string when available. */ + stableDeviceId?: string; + } + interface DeviceIdLists { + /** + * List of input devices specified by their ID. + * To indicate input devices should be unaffected, leave this property unset. + */ + input?: string[]; + /** + * List of output devices specified by their ID. + * To indicate output devices should be unaffected, leave this property unset. + */ + output?: string[]; + } + interface SetDeviceProperties { + /** + * 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; + } + 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; + } + 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; + } + interface OnDeviceListChangedEvent { + /** + * The callback parameter should be a function that looks like this: + * function(array of AudioDeviceInfo devices) {...}; + * @param {(devices: AudioDeviceInfo[]) => void} callback `devices` contains a list of all present audio devices after the change. + */ + 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. + */ + interface Filter { + /** + * @description 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. + */ + isActive?: boolean; + } + /** + * @description 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; + /** Sets lists of active input and/or output devices. */ + export 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; + /** + * @description 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. + */ + export 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. + * @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() {...}; + */ + export function setMute(streamType: StreamType, isMuted: boolean, callback?: () => void): void; + /** Fired when sound level changes for an active audio device. */ + export var 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; + /** Fired when audio devices change, either new devices being added, or existing devices being removed. */ + export var onDeviceListChanged: OnDeviceListChangedEvent; + } + + //////////////////// + // 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 + */ + namespace bluetooth { + interface AdapterState { + address: string; + name: string; + powered: boolean; + available: boolean; + discovering: boolean; + } + interface Device { + address: string; + name?: string; + deviceClass?: number; + vendorIdSource?: 'bluetooth' | 'usb'; + vendorId?: number; + productId?: number; + deviceId?: number; + type?: "computer" | "phone" | "modem" | "audio" | "carAudio" | "video" | "peripheral" | "joystick" | "gamepad" | "keyboard" | "mouse" | "tablet" | "keyboardMouseCombo"; + paired?: boolean; + connected?: boolean; + /** + * @since Chrome 48 + */ + connecting?: boolean; + /** + * @since Chrome 48 + */ + connectable?: boolean; + uuids?: string[]; + /** + * @since Chrome 44 + */ + inquiryRssi: number; + /** + * @since Chrome 44 + */ + inquiryTxPower: number; + } + + interface BluetoothEvent { + addListener(callback: (event: T) => void): void; + } + + /** + * 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'; + /** 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; + /** Get information about a Bluetooth device known to the system. */ + export 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 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; + /** + * 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; + /** Stop discovery. */ + export function stopDiscovery(callback: () => void): void; + /** Fired when the state of the Bluetooth adapter changes. */ + export var onAdapterStateChanged: BluetoothEvent; + /** Fired when information about a new Bluetooth device is available. */ + export var onDeviceAdded: BluetoothEvent; + /** Fired when information about a known Bluetooth device has changed. */ + export var 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 */ + } + + //////////////////// + // Browser + //////////////////// + /** + * Use the chrome.browser API to interact with the Chrome browser associated with + * the current application and Chrome profile. + */ + namespace browser { + interface Options { + /** The URL to navigate to when the new tab is initially opened. */ + url: string; + } + + /** + * Opens a new tab in a browser window associated with the current application + * and Chrome profile. If no browser window for the Chrome profile is opened, + * a new one is opened prior to creating the new tab. + * @param options Configures how the tab should be opened. + * @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; + + /** + * Opens a new tab in a browser window associated with the current application + * and Chrome profile. If no browser window for the Chrome profile is opened, + * 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; + } + + //////////////////// + // Commands + //////////////////// + /** + * 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": {...} + */ + namespace commands { + interface Command { + /** Optional. The name of the Extension Command */ + name?: string; + /** Optional. The Extension Command description */ + description?: string; + /** Optional. The shortcut active for this command, or blank if not active. */ + shortcut?: string; + } + + interface CommandEvent extends chrome.events.Event<(command: string) => void> { } + + /** + * 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; + + /** Fired when a registered command is activated using a keyboard shortcut. */ + export var onCommand: CommandEvent; + } + + //////////////////// + // 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" + */ + namespace contextMenus { + /** + * 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"; + /** + * The type of menu item. + **/ + export type ItemType = "normal" | "checkbox" | "radio" | "separator"; + + 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; + /** + * @since Since Chrome 35. + * A flag indicating whether the element is editable (text input, textarea, etc.). + */ + editable: boolean; + /** + * Optional. + * @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; + /** + * 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. + */ + 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. + */ + srcUrl?: string; + } + + 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[]; + /** + * Optional. + * Whether this context menu item is enabled or disabled. Defaults to true. + * @since Since Chrome 20. + */ + 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[]; + /** + * 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; + /** + * 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; + /** + * @description Whether the item is visible in the menu. + * @since Since Chrome 62 + */ + visible?: boolean; + } + + interface UpdateProperties { + documentUrlPatterns?: string[]; + checked?: boolean; + title?: string; + contexts?: string[]; + /** + * @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 + */ + visible?: 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. + */ + export var ACTION_MENU_TOP_LEVEL_LIMIT: number; + + /** + * 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; + + /** + * Since Chrome 21. + * Fired when a context menu item is clicked. + */ + export var onClicked: MenuClickedEvent; + + } + + //////////////////// + // Document Scan + //////////////////// + /** + * 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. + */ + namespace documentScan { + interface DocumentScanOptions { + /** Optional. The MIME types that are accepted by the caller. */ + mimeTypes?: string[]; + /** Optional. 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. */ + dataUrls: string[]; + /** The MIME type of dataUrls. */ + mimeType: string; + } + + /** + * 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; + } + + //////////////////// + // Events + //////////////////// + /** + * The chrome.events namespace contains common types used by APIs dispatching events to notify you when something interesting happens. + * Availability: Since Chrome 21. + */ + namespace events { + /** Filters URLs for various 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. + */ + 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. + */ + originAndPathMatches?: string; + } + + /** An object which allows the addition and removal of listeners for a Chrome event. */ + interface Event { + /** + * Registers an event listener callback to an event. + * @param callback Called when an event occurs. The parameters of this function depend on the type of event. + * The callback parameter should be a function that looks like this: + * function() {...}; + */ + addListener(callback: T): void; + /** + * Returns currently registered rules. + * @param callback Called with registered rules. + * The callback parameter 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. + */ + getRules(callback: (rules: Rule[]) => void): void; + /** + * Returns currently registered rules. + * @param ruleIdentifiers If an array is passed, only rules with identifiers contained in this array are returned. + * @param callback Called with registered rules. + * The callback parameter 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. + */ + getRules(ruleIdentifiers: string[], callback: (rules: Rule[]) => void): void; + /** + * @param callback Listener whose registration status shall be tested. + */ + hasListener(callback: T): boolean; + /** + * Unregisters currently registered rules. + * @param ruleIdentifiers If an array is passed, only rules with identifiers contained in this array are unregistered. + * @param callback Called when rules were unregistered. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + removeRules(ruleIdentifiers?: string[], callback?: () => void): void; + /** + * 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; + 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. */ + 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. + */ + tags?: string[]; + } + } + + //////////////////// + // Extension Types + //////////////////// + + /** + * Primary for extensions, but also used in apps. + * https://developer.chrome.com/extensions/extensionTypes#type-ImageDetails + **/ + namespace extensionTypes { + /** + * The format of an image. + **/ + export 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 + */ + 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 + */ + quality?: number; + } + /** + * The soonest that the JavaScript or CSS will be injected into the tab. + **/ + export type RunAt = 'document_start' | 'document_end' | 'document_idle'; + /** + * The origin of injected CSS. + **/ + export 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 + */ + interface InjectDetails { + /** + * 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 + */ + 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; + } + } + + //////////////////// + // FileSystem + //////////////////// + namespace fileSystem { + + interface AcceptOptions { + description?: string; + mimeTypes?: string[]; + extensions?: string[]; + } + + interface ChooseEntryOptions { + type?: string; + suggestedName?: string; + accepts?: AcceptOptions[]; + acceptsAllTypes?: boolean; + 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; + } + + + //////////////////// + // 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. + */ + 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; + } + + 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; + /** The last modified time of this entry. */ + modificationTime: Date; + /** Optional. 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?: 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). */ + writable: boolean; + /** + * The maximum number of files that can be opened at once. If 0, then not limited. + * @since Since Chrome 42. + */ + openedFilesLimit: number; + /** + * 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. + */ + supportsNotifyTag?: boolean; + /** + * List of watchers. + * @since Since Chrome 45. Warning: this is the current Beta channel. + */ + watchers: FileWatchersInfo[]; + } + + /** @since Since Chrome 45. Warning: this is the current Beta channel. */ + interface GetActionsRequestedOptions { + /** The identifier of the file system related to this operation. */ + fileSystemId: string; + /** The unique identifier of this request. */ + requestId: number; + /** The path of the entry to return the list of actions for. */ + 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. */ + title?: string; + } + + /** @since Since Chrome 45. Warning: this is the current Beta channel. */ + interface ExecuteActionRequestedOptions { + /** The identifier of the file system related to this operation. */ + fileSystemId: string; + /** The unique identifier of this request. */ + requestId: number; + /** The path of the entry to be used for the action. */ + entryPath: string; + /** The identifier of the action to be executed. */ + actionId: string; + } + + interface MountOptions { + /** The string indentifier of the file system. Must be unique per each extension. */ + 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). */ + writable?: boolean; + /** + * Optional. + * 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; + /** + * Optional. + * Whether the file system supports the tag field for observed directories. + * @since Since Chrome 45. Warning: this is the current Beta channel. + */ + supportsNotifyTag?: boolean; + } + + interface UnmountOptions { + /** The identifier of the file system to be unmounted. */ + fileSystemId: string; + } + + interface NotificationChange { + /** The path of the changed entry. */ + entryPath: string; + /** The type of the change which happened to the entry. */ + changeType: string; + } + + interface NotificationOptions { + /** The identifier of the file system related to this change. */ + fileSystemId: string; + /** The path of the observed entry. */ + 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) */ + 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?: string; + } + + interface RequestedEventOptions { + /** The identifier of the file system related to this operation. */ + fileSystemId: string; + /** The unique identifier of this request. */ + requestId: number; + } + + interface EntryPathRequestedEventOptions extends RequestedEventOptions { + /** The path of the entry to which this operation is related to. */ + entryPath: string; + } + + interface MetadataRequestedEventOptions extends EntryPathRequestedEventOptions { + /** Set to true if the thumbnail is requested. */ + thumbnail: boolean; + } + + interface DirectoryPathRequestedEventOptions extends RequestedEventOptions { + /** The path of the directory which is to be operated on. */ + directoryPath: string; + } + + interface FilePathRequestedEventOptions extends RequestedEventOptions { + /** The path of the entry for the operation */ + filePath: string; + } + + interface OpenFileRequestedEventOptions extends FilePathRequestedEventOptions { + /** Whether the file will be used for reading or writing. */ + mode: string; + } + + interface OpenedFileRequestedEventOptions extends RequestedEventOptions { + /** A request ID used to open the file. */ + openRequestId: number; + } + + interface OpenedFileOffsetRequestedEventOptions extends OpenedFileRequestedEventOptions { + /** Position in the file (in bytes) to start reading from. */ + offset: number; + /** Number of bytes to be returned. */ + length: number; + } + + interface DirectoryPathRecursiveRequestedEventOptions extends DirectoryPathRequestedEventOptions { + /** Whether the operation is recursive (for directories only). */ + recursive: boolean; + } + + interface EntryPathRecursiveRequestedEventOptions extends EntryPathRequestedEventOptions { + /** Whether the operation is recursive (for directories only). */ + recursive: boolean; + } + + interface SourceTargetPathRequestedEventOptions extends 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 OpenedFileIoRequestedEventOptions extends OpenedFileRequestedEventOptions { + /** 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 { + /** An ID of the request to which this operation is related. */ + operationRequestId: number; + } + + 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> { } + + /** + * 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. + * 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; + /** + * 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; + /** + * 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; + /** + * 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; + /** + * 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. + * 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() {...}; + */ + export function notify(options: NotificationOptions, callback: () => 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; + /** + * 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; + /** + * 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; + /** + * 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. + */ + export var onAddWatcherRequested: EntryPathRecursiveRequestedEvent; + /** + * 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. + */ + export var onRemoveWatcherRequested: EntryPathRecursiveRequestedEvent; + } + + //////////////////// + // 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" + */ + namespace gcm { + 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; + } + + interface IncomingMessage { + /** The message data. */ + data: Object; + /** + * Optional. + * The sender who issued the message. + * @since Since Chrome 41. + */ + from?: string; + /** + * Optional. + * The collapse key of a message. See Collapsible Messages section of Cloud Messaging documentation for details. + */ + collapseKey?: string; + } + + 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. */ + 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. + * @param callback Function called when registration completes. It should check runtime.lastError for error when registrationId is empty. + * The callback parameter should be a function that looks like this: + * 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; + /** + * 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; + /** + * Sends a message according to its contents. + * @param message A message to send to the other party via GCM. + * @param callback A function called after the message is successfully queued for sending. runtime.lastError should be checked, to ensure a message was sent without problems. + * The callback parameter should be a function that looks like this: + * 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; + + /** Fired when a message is received through GCM. */ + export var onMessage: MessageReceptionEvent; + /** 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; + /** Fired when it was not possible to send a message to the GCM server. */ + export var onSendError: GcmErrorEvent; + } + + //////////////////// + // 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 + */ + namespace hid { + /** NOT YET IMPLEMENTED */ + } + + //////////////////// + // i18n + //////////////////// + /** + * Use the chrome.i18n infrastructure to implement internationalization across your whole app or extension. + * @since Chrome 5. + */ + namespace i18n { + /** 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; + + /** The percentage of the detected language */ + percentage: number; + } + + /** Holds detected language reliability and array of DetectedLanguage */ + interface LanguageDetectionResult { + /** CLD detected language reliability */ + isReliable: boolean; + + /** 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 + */ + export function getAcceptLanguages(callback: (languages: string[]) => 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. + * @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. + */ + export function getMessage(messageName: string, substitutions?: any): string; + /** + * 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; + + /** 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) {...}; + */ + export function detectLanguage(text: string, callback: (result: LanguageDetectionResult) => void): void; + } + + //////////////////// + // Identity + //////////////////// + /** + * Use the chrome.identity API to get OAuth2 access tokens. + * Permissions: "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. */ + 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. + */ + 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. + * @since Chrome 37. + */ + account?: AccountInfo; + /** + * Optional. + * A list of OAuth2 scopes to request. + * When the scopes field is present, it overrides the list of scopes specified in manifest.json. + * @since Chrome 37. + */ + scopes?: string[]; + } + + 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. */ + 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. */ + id: string; + } + + interface TokenInformation { + /** The specific token that should be removed from the cache. */ + token: string; + } + + interface WebAuthFlowOptions { + /** The URL that initiates the auth flow. */ + url: string; + /** + * Optional. + * Whether to launch auth flow in interactive mode. + * Since some auth flows may immediately redirect to a result URL, launchWebAuthFlow hides its web view until the first navigation either redirects to the final URL, or finishes loading a page meant to be displayed. + * If the interactive flag is true, the window will be displayed when a page load completes. If the flag is false or omitted, launchWebAuthFlow will return with an error if the initial navigation does not complete the flow. + */ + interactive?: boolean; + } + + interface SignInChangeEvent extends chrome.events.Event<(account: AccountInfo, signedIn: boolean) => void> { } + + /** + * 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; + /** + * 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) {...}; + */ + export 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. + * @since Chrome 37. + */ + export 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. + * @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; + /** + * 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. + * @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; + /** + * 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. + */ + export 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; + } + + //////////////////// + // Idle + //////////////////// + /** + * Use the chrome.idle API to detect when the machine's idle state changes. + * Permissions: "idle" + * @since Chrome 6. + */ + namespace idle { + interface IdleStateChangedEvent extends chrome.events.Event<(newState: string) => void> { } + + /** + * 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; + /** + * 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; + + /** 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; + } + + //////////////////// + // InstanceID + //////////////////// + /** + * Use chrome.instanceID to access the Instance ID service. + * @since Chrome 46 + */ + namespace instanceID { + /** NOT YET IMPLEMENTED */ + } + + //////////////////// + // 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/ + * @since Chrome 31 + */ + namespace mdns { + /** NOT YET IMPLEMENTED */ + } + + //////////////////// + // Media Galleries + //////////////////// + namespace mediaGalleries { + interface MediaFileSystemsOptions { + interactive?: 'no' | 'yes' | 'if_needed'; + } + + interface MediaFileSystemMetadata { + name: string; + galleryId: string; + deviceId?: string; + isRemovable: boolean; + isMediaDevice: boolean; + isAvailable: boolean; + } + + interface MetadataOptions { + metadataType: 'all' | 'mimeTypeAndTags' | 'mimeTypeOnly'; + } + + interface RawTag { + type: string; + tags: { [name: string]: string; }; + } + + interface Metadata { + // 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. + album?: string; + artist?: string; + comment?: string; + copyright?: string; + disc?: number; + genre?: string; + 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. + rawTags: RawTag[]; + // The images embedded in the media file's metadata. This is most often used for album art or video thumbnails. + attachedImages: Blob[]; + } + + interface GalleryWatchResult { + galleryId: string; + success: boolean; + } + + interface GalleryChangedEventArgs { + type: 'contents_changed' | 'watch_dropped'; + galleryId: string; + } + + 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; + } + + 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>; + } + + //////////////////////////////////// + // 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. + */ + 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 + } + interface ManagedLong { + /** + * @description The active value currently used by the network configuration manager (e.g. Shill). + * @type {number} + * @memberof ManagedLong + */ + Active?: number, + /** + * @description The source from which the effective property value was determined. + * @type {string} + * @memberof ManagedLong + */ + 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 + } + } + + //////////////////// + // Notifications + // https://developer.chrome.com/extensions/notifications + //////////////////// + /** + * Use the chrome.notifications API to create rich notifications using templates and show these notifications to users in the system tray. + * Permissions: "notifications" + * @since Chrome 28. + */ + namespace notifications { + interface ButtonOptions { + title: string; + iconUrl?: string; + } + + interface ItemOptions { + /** Title of one item of a list notification. */ + title: string; + /** Additional details about this item. */ + message: string; + } + + interface NotificationOptions { + /** Optional. Which type of notification to display. Required for notifications.create method. */ + type?: string; + /** + * Optional. + * A URL to the sender's avatar, app icon, or a thumbnail for image notifications. + * 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?: string; + /** Optional. Main notification content. Required for notifications.create method. */ + message?: string; + /** + * Optional. + * Alternate notification content with a lower-weight font. + * @since Chrome 31. + */ + contextMessage?: string; + /** Optional. 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). */ + eventTime?: number; + /** Optional. Text and icons for up to two notification action buttons. */ + buttons?: ButtonOptions[]; + /** Optional. Items for multi-item notifications. */ + items?: ItemOptions[]; + /** + * Optional. + * Current progress ranges from 0 to 100. + * @since Chrome 30. + */ + progress?: number; + /** + * Optional. + * Whether to show UI indicating that the app will visibly respond to clicks on the body of a notification. + * @since Chrome 32. + */ + isClickable?: boolean; + /** + * Optional. + * A URL to the app icon mask. URLs have the same restrictions as iconUrl. The app icon mask should be in alpha channel, as only the alpha channel of the image will be considered. + * @since Chrome 38. + */ + appIconMaskUrl?: string; + /** Optional. 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. + * This defaults to false. + * @since Chrome 50 + */ + requireInteraction?: boolean; + } + + interface NotificationClosedEvent extends chrome.events.Event<(notificationId: string, byUser: boolean) => void> { } + + interface NotificationClickedEvent extends chrome.events.Event<(notificationId: string) => void> { } + + interface NotificationButtonClickedEvent extends chrome.events.Event<(notificationId: string, buttonIndex: number) => void> { } + + interface NotificationPermissionLevelChangedEvent extends chrome.events.Event<(level: string) => void> { } + + interface NotificationShowSettingsEvent extends chrome.events.Event<() => void> { } + + /** The notification closed, either by the system or by user action. */ + export var onClosed: NotificationClosedEvent; + /** The user clicked in a non-button area of the notification. */ + export var onClicked: NotificationClickedEvent; + /** The user pressed a button in the notification. */ + export var onButtonClicked: NotificationButtonClickedEvent; + /** + * The user changes the permission level. + * @since Chrome 32. + */ + export var onPermissionLevelChanged: NotificationPermissionLevelChangedEvent; + /** + * The user clicked on a link for the app's notification settings. + * @since Chrome 32. + */ + export var onShowSettings: NotificationShowSettingsEvent; + + /** + * 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. + * The notificationId parameter is required before Chrome 42. + * @param options Contents of the notification. + * @param callback Returns the notification id (either supplied or generated) that represents the created notification. + * The callback is required before Chrome 42. + * 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; + /** + * 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. + * The notificationId parameter is required before Chrome 42. + * @param options Contents of the notification. + * @param callback Returns the notification id (either supplied or generated) that represents the created notification. + * The callback is required before Chrome 42. + * 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; + /** + * Updates an existing notification. + * @param notificationId The id of the notification to be updated. This is returned by notifications.create method. + * @param options Contents of the notification to update to. + * @param callback Called to indicate whether a matching notification existed. + * The callback is required before Chrome 42. + * 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; + /** + * Clears the specified notification. + * @param notificationId The id of the notification to be cleared. This is returned by notifications.create method. + * @param callback Called to indicate whether a matching notification existed. + * The callback is required before Chrome 42. + * 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; + /** + * Retrieves all the notifications. + * @since Chrome 29. + * @param callback Returns the set of notification_ids currently in the system. + * The callback parameter should be a function that looks like this: + * function(object notifications) {...}; + */ + export function getAll(callback: (notifications: Object) => void): void; + /** + * Retrieves whether the user has enabled notifications from this app or extension. + * @since Chrome 32. + * @param callback Returns the current permission level. + * The callback parameter should be a function that looks like this: + * function( PermissionLevel level) {...}; + */ + export function getPermissionLevel(callback: (level: string) => void): void; + } + + //////////////////// + // Permissions + //////////////////// + /** + * Use the chrome.permissions API to request declared optional permissions at run time rather than install time, so users understand why the permissions are needed and grant only those that are necessary. + * @since Chrome 16. + */ + namespace permissions { + interface Permissions { + /** + * Optional. + * List of named permissions (does not include hosts or origins). Anything listed here must appear in the optional_permissions list in the manifest. + */ + origins?: string[]; + /** + * Optional. + * List of origin permissions. Anything listed here must be a subset of a host that appears in the optional_permissions list in the manifest. For example, if http://*.example.com/ or http://* appears in optional_permissions, you can request an origin of http://help.example.com/. Any path is ignored. + */ + permissions?: string[]; + } + + interface PermissionsRemovedEvent { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( Permissions permissions) {...}; + * Parameter permissions: The permissions that have been removed. + */ + addListener(callback: (permissions: Permissions) => void): void; + } + + interface PermissionsAddedEvent { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( Permissions permissions) {...}; + * Parameter permissions: The newly acquired permissions. + */ + addListener(callback: (permissions: Permissions) => void): void; + } + + /** + * Checks if the extension has the specified permissions. + * @param callback The callback parameter should be a function that looks like this: + * function(boolean result) {...}; + * Parameter result: True if the extension has the specified permissions. + */ + export 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; + /** + * 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: + * function(boolean granted) {...}; + * Parameter granted: True if the user granted the specified permissions. + */ + export 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: + * function(boolean removed) {...}; + * Parameter removed: True if the permissions were removed. + */ + export function remove(permissions: Permissions, callback?: (removed: boolean) => void): void; + + /** Fired when access to permissions has been removed from the extension. */ + export var onRemoved: PermissionsRemovedEvent; + /** Fired when the extension acquires new permissions. */ + export var onAdded: PermissionsAddedEvent; + } + + //////////////////// + // Power + //////////////////// + /** + * Use the chrome.power API to override the system's power management features. + * 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; + /** Releases a request previously made via requestKeepAwake(). */ + export function releaseKeepAwake(): void; + } + + //////////////////// + // Printer Provider + //////////////////// + /** + * 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" + * @since Chrome 44. + */ + namespace printerProvider { + interface PrinterInfo { + /** Unique printer ID. */ + id: string; + /** Printer's human readable name. */ + name: string; + /** Optional. Printer's human readable description. */ + description?: string; + } + + interface PrinterCapabilities { + /** Device capabilities in CDD format. */ + capabilities: any; + } + + interface PrintJob { + /** ID of the printer which should handle the job. */ + printerId: string; + /** The print job title. */ + title: string; + /** Print ticket in CJT format. */ + ticket: Object; + /** 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; + /** + * 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; + /** Event fired when print manager requests printer capabilities. */ + export var onGetCapabilityRequested: CapabilityRequestedEvent; + /** Event fired when print manager requests printing. */ + export var onPrintRequested: PrintRequestedEvent; + } + + //////////////////// + // Runtime + //////////////////// + /** + * Use the chrome.runtime API to retrieve the background page, return details about the manifest, and listen for and respond to events in the app or extension lifecycle. You can also use this API to convert the relative path of URLs to fully-qualified URLs. + * @since Chrome 22 + */ + namespace runtime { + /** This will be defined during an API method callback if there was an error */ + export var lastError: LastError | undefined; + /** The ID of the extension/app. */ + export var id: string; + + interface LastError { + /** Optional. Details about the error which occurred. */ + message?: string; + } + + interface ConnectInfo { + name?: string; + } + + interface InstalledDetails { + /** + * The reason that this event is being dispatched. + * One of: "install", "update", "chrome_update", or "shared_module_update" + */ + reason: string; + /** + * Optional. + * Indicates the previous version of the extension, which has just been updated. This is present only if 'reason' is 'update'. + */ + previousVersion?: string; + /** + * Optional. + * Indicates the ID of the imported shared module extension which updated. This is present only if 'reason' is 'shared_module_update'. + * @since Chrome 29. + */ + id?: string; + } + + interface MessageOptions { + /** Whether the TLS channel ID will be passed into onMessageExternal for processes that are listening for the connection event. */ + includeTlsChannelId?: boolean; + } + + /** + * An object containing information about the script context that sent a message or request. + * @since Chrome 26. + */ + interface MessageSender { + /** The ID of the extension or app that opened the connection, if any. */ + id?: string; + /** + * The frame that opened the connection. 0 for top-level frames, positive for child frames. This will only be set when tab is set. + * @since Chrome 41. + */ + frameId?: number; + /** + * The URL of the page or frame that opened the connection. If the sender is in an iframe, it will be iframe's URL not the URL of the page which hosts it. + * @since Chrome 28. + */ + url?: string; + /** + * The TLS channel ID of the page or frame that opened the connection, if requested by the extension or app, and if available. + * @since Chrome 32. + */ + tlsChannelId?: string; + } + + /** + * An object containing information about the current platform. + * @since Chrome 36. + */ + interface PlatformInfo { + /** + * The operating system chrome is running on. + * One of: "mac", "win", "android", "cros", "linux", or "openbsd" + */ + os: string; + /** + * The machine's processor architecture. + * 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" + */ + nacl_arch: string; + } + + /** + * An object which allows two way communication with other pages. + * @since Chrome 26. + */ + interface Port { + postMessage: (message: Object) => void; + disconnect: () => void; + /** + * Optional. + * This property will only be present on ports passed to onConnect/onConnectExternal listeners. + */ + sender?: MessageSender; + /** An object which allows the addition and removal of listeners for a Chrome event. */ + onDisconnect: PortDisconnectEvent; + /** An object which allows the addition and removal of listeners for a Chrome event. */ + onMessage: PortMessageEvent; + name: string; + } + + interface UpdateAvailableDetails { + /** The version number of the available update. */ + version: string; + } + + interface UpdateCheckDetails { + /** The version of the available update. */ + 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; + } + + interface ManifestAction { + default_icon?: ManifestIcons; + default_title?: string; + default_popup?: string; + } + + interface SearchProvider { + name?: string; + keyword?: string; + favicon_url?: string; + search_url: string; + encoding?: string; + suggest_url?: string; + instant_url?: string; + image_url?: string; + search_url_post_params?: string; + suggest_url_post_params?: string; + instant_url_post_params?: string; + image_url_post_params?: string; + alternate_urls?: string[]; + prepopulated_id?: number; + is_default?: boolean; + } + + interface Manifest { + /** Required */ + app: { + background: { + scripts?: string[]; + } + } + /** Should be set to 2 */ + manifest_version: number; + name: string; + version: string; + + // Recommended + default_locale?: string; + description?: string; + icons?: ManifestIcons; + // Optional + action_handlers?: string[]; + author?: any; + automation?: any; + bluetooth?: { + uuids?: string[]; + socket?: boolean; + low_energy?: boolean; + peripheral?: boolean; + }; + commands?: { + [name: string]: { + suggested_key?: { + default?: string; + windows?: string; + mac?: string; + chromeos?: string; + linux?: string; + }; + description?: string; + global?: boolean + } + }; + current_locale?: string; + event_rules?: { + event?: string; + actions?: { + type: string; + }[]; + conditions?: { + type: string, + css?: string[] + }[]; + }[]; + file_handlers?: { + [key: string]: { + extensions?: Array<'*' | string | { include_directories: boolean }>; + types?: Array<'*' | string | { include_directories: boolean }>; + } + }[]; + file_system_provider_capabilities?: { + configurable?: boolean; + multiple_mounts?: boolean; + source?: string; + }; + import?: { + id: string; + }[]; + key?: string; + kiosk?: { + always_update: any; + required_platform_version: any; + }; + kiosk_enabled?: boolean, + kiosk_only?: boolean, + kiosk_secondary_apps: any; + minimum_chrome_version?: string; + nacl_modules?: { + path: string; + mime_type: string; + }[]; + oauth2?: { + client_id: string; + scopes?: string[]; + }; + offline_enabled?: boolean; + optional_permissions?: string[]; + permissions?: string[]; + platforms?: { + nacl_arch?: string; + 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. + */ + 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"] + * } + * } + */ + '3D'?: { + 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 + * } + * } + */ + plugins?: { + npapi?: boolean; + } + + [key: string]: any; + }; + /** + * @deprecated Warning: Starting in version 57, Chrome will no longer allow external web content (including embedded frames and scripts) inside sandboxed pages. Please use a webview instead. + */ + sandbox?: { + pages: string[]; + content_security_policy?: string; + }; + short_name?: string; + signature?: any; + sockets?: { + tcp?: { + connect: string | '*'; + }; + udp?: { + send: string | '*'; + } + }; + storage?: { + managed_schema: string + }; + system_indicator?: any; + update_url?: string; + url_handlers?: { + [name: string]: { + matches: string[]; + title?: string; + } + }; + usb_printers?: { + filters: { + vendorId?: number; + productId?: number; + interfaceClass?: number; + interfaceSubclass?: number; + interfaceProtocol?: number; + }[] + }; + version_name?: string; + webview?: { + partitions?: { + name: string; + accessible_resources: string[]; + }[] + } + [key: string]: any; + } + + /** + * 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; + /** + * 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; + /** + * 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; + /** + * 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; + /** + * Returns a DirectoryEntry for the package directory. + * @since Chrome 29. + */ + export 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; + /** + * 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; + /** + * Reloads the app or extension. + * @since Chrome 25. + */ + export 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" + * 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; + /** + * Restart the ChromeOS device when the app runs in kiosk mode. Otherwise, it's no-op. + * @since Chrome 32. + */ + export 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; + /** + * 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; + /** + * 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 extensionId The ID of the extension/app to send the message to. If omitted, the message will be sent to your own extension/app. Required if sending messages from a web page for web messaging. + * @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; + /** + * 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 extensionId The ID of the extension/app to send the message to. If omitted, the message will be sent to your own extension/app. Required if sending messages from a web page for web messaging. + * @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; + /** + * Send a single message to a native application. + * @since Chrome 28. + * @param application The of the native messaging host. + * @param message The message that will be passed to the native messaging host. + * @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; + /** + * 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. + * @param url Since Chrome 34. + * 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; + /** + * 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; + + /** + * Fired when a connection is made from either an extension process or a content script. + * @since Chrome 26. + */ + export var onConnect: ExtensionConnectEvent; + /** + * Fired when a connection is made from another extension. + * @since Chrome 26. + */ + export var 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; + /** + * 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; + /** 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; + /** Sent after onSuspend to indicate that the app won't be unloaded after all. */ + export var onSuspendCanceled: RuntimeEvent; + /** + * Fired when a message is sent from either an extension process or a content script. + * @since Chrome 26. + */ + export var 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; + /** + * 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; + /** + * 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; + /** + * @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; + } + + //////////////////// + // Serial + //////////////////// + /** + * Use the chrome.serial API to read from and write to a device connected to a serial port. + * @since Chrome 23 + */ + namespace serial { + /** NOT YET IMPLEMENTED */ + } + + //////////////////// + // Socket + //////////////////// + namespace socket { + interface CreateInfo { + socketId: number; + } + + interface AcceptInfo { + resultCode: number; + socketId?: number; + } + + interface ReadInfo { + resultCode: number; + data: ArrayBuffer; + } + + interface WriteInfo { + bytesWritten: number; + } + + interface RecvFromInfo { + resultCode: number; + data: ArrayBuffer; + port: number; + address: string; + } + + interface SocketInfo { + socketType: string; + localPort?: number; + peerAddress?: string; + peerPort?: number; + localAddress?: string; + connected: boolean; + } + + interface NetworkInterface { + name: string; + 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; + } + + namespace sockets.tcp { + interface CreateInfo { + socketId: number; + } + + interface SendInfo { + resultCode: number; + bytesSent?: number; + } + + interface ReceiveEventArgs { + socketId: number; + data: ArrayBuffer; + } + + interface ReceiveErrorEventArgs { + socketId: number; + resultCode: number; + } + + interface SocketProperties { + persistent?: boolean; + name?: string; + bufferSize?: number; + } + + interface SocketInfo { + socketId: number; + persistent: boolean; + name?: string; + bufferSize?: number; + paused: boolean; + connected: boolean; + localAddress?: string; + localPort?: number; + peerAddress?: string; + peerPort?: number; + } + + export function create(callback: (createInfo: CreateInfo) => void): void; + export 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; + + export function setKeepAlive(socketId: number, + enable: boolean, callback: (result: number) => void): void; + export 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, + 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; + + export var onReceive: chrome.events.Event<(args: ReceiveEventArgs) => void>; + export var onReceiveError: chrome.events.Event<(args: ReceiveErrorEventArgs) => void>; + } + + /** + * Use the chrome.sockets.tcpServer API to create server applications using TCP + * connections. This API supersedes the TCP functionality previously found in + * the chrome.socket API. + * + * @since Chrome 33 + * @see https://developer.chrome.com/apps/sockets_tcpServer + */ + namespace sockets.tcpServer { + interface CreateInfo { + socketId: number; + } + + interface AcceptEventArgs { + socketId: number; + clientSocketId: number; + } + + interface AcceptErrorEventArgs { + socketId: number; + resultCode: number; + } + + /** + * @see https://developer.chrome.com/apps/sockets_tcpServer#type-SocketProperties + */ + 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 loaded, any sockets previously opened with + * persistent=true can be fetched with getSockets. + * + * @see http://developer.chrome.com/apps/app_lifecycle.html + */ + persistent?: boolean; + + /** An application-defined string associated with the socket. */ + name?: string; + } + + /** + * @see https://developer.chrome.com/apps/sockets_tcpServer#type-SocketInfo + */ + interface SocketInfo { + /** The socket identifier. */ + socketId: number; + + /** + * 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; + + /** + * 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" + */ + paused: boolean; + + /** If the socket is listening, contains its local IPv4/6 address. */ + localAddress?: string; + + /** If the socket is listening, contains its local port. */ + localPort?: number; + } + + /** + * Creates a TCP server socket. + * + * @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; + + /** + * Creates a TCP server socket. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-create + * @param properties The socket properties. + * @param callback Called when the socket has been created. + */ + export function create(properties: SocketProperties, callback: (createInfo: CreateInfo) => void): void; + + /** + * Updates the socket properties. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-update + * @param socketId The socket identifier. + * @param properties The properties to update. + * @param callback Called when the properties are updated. + */ + export function update(socketId: number, properties: SocketProperties, callback?: () => void): void; + + /** + * Enables or disables a listening socket from accepting new connections. + * When paused, a listening socket accepts new connections until its backlog + * (see listen function) is full then refuses additional connection + * requests. onAccept events are raised only when the socket is un-paused. + * + * @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; + + /** + * Listens for connections on the specified port and address. If the + * port/address is in use, the callback indicates a failure. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-listen + * @param socketId The socket identifier. + * @param address The address of the local machine. + * @param port The port of the local machine. When set to 0, a free port + * is chosen dynamically. The dynamically allocated port can + * be found by calling getInfo. + * @param backlog Length of the socket's listen queue. The default value + * depends on the Operating System (SOMAXCONN), which + * 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; + + /** + * Listens for connections on the specified port and address. If the + * port/address is in use, the callback indicates a failure. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-listen + * @param socketId The socket identifier. + * @param address The address of the local machine. + * @param port The port of the local machine. When set to 0, a free port + * is chosen dynamically. The dynamically allocated port can + * 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; + + /** + * Disconnects the listening socket, i.e. stops accepting new connections + * and releases the address/port the socket is bound to. The socket + * identifier remains valid, e.g. it can be used with listen to accept + * connections on a new port and address. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-disconnect + * @param socketId The socket identifier. + * @param callback Called when the disconnect attempt is complete. + */ + export function disconnect(socketId: number, 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. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-close + * @param socketId The socket identifier. + * @param callback Called when the close operation completes. + */ + export function close(socketId: number, callback?: () => void): void; + + /** + * Retrieves the state of the given socket. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-getInfo + * @param socketId The socket identifier. + * @param callback Called when the socket state is available. + */ + export function getInfo(socketId: number, callback: (socketInfo: SocketInfo) => void): void; + + /** + * Retrieves the list of currently opened sockets owned by the application. + * + * @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; + + /** + * 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>; + + /** + * Event raised when a network error occured while the runtime was waiting + * for new connections on the socket address and port. Once this event is + * raised, the socket is set to paused and no more onAccept events are + * raised for this socket until the socket is resumed. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#event-onAcceptError + */ + export var 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. + * + * @since Chrome 33 + * @see https://developer.chrome.com/apps/sockets_udp + */ + namespace sockets.udp { + interface CreateInfo { + socketId: number; + } + + interface SendInfo { + resultCode: number; + bytesSent?: number; + } + + interface ReceiveEventArgs { + socketId: number; + data: ArrayBuffer; + remoteAddress: string; + remotePort: number; + } + + interface ReceiveErrorEventArgs { + socketId: number; + resultCode: number; + } + + /** + * @see https://developer.chrome.com/apps/sockets_udp#type-SocketProperties + */ + 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 loaded, any sockets previously opened with + * persistent=true can be fetched with getSockets. + * @see http://developer.chrome.com/apps/app_lifecycle.html + */ + persistent?: boolean; + + /** An application-defined string associated with the socket. */ + name?: string; + + /** + * 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. + */ + bufferSize?: number; + } + + /** + * @see https://developer.chrome.com/apps/sockets_udp#type-SocketInfo + */ + interface SocketInfo { + /** The socket identifier. */ + socketId: number; + + /** + * Flag indicating whether the socket is left open when the application + * is suspended (see SocketProperties.persistent). + */ + persistent: boolean; + + /** Application-defined string associated with the socket. */ + name?: string; + + /** + * The size of the buffer used to receive data. If no buffer size ha + * been specified explictly, the value is not provided. + */ + bufferSize?: number; + + /** + * Flag indicating whether the socket is blocked from firing onReceive + * events. + */ + paused: boolean; + + /** + * If the underlying socket is bound, contains its local IPv4/6 address. + */ + localAddress?: string; + + /** + * If the underlying socket is bound, contains its local port. + */ + localPort?: number; + } + + /** + * Creates a UDP socket with default properties. + * + * @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; + + /** + * Creates a UDP socket with the given properties. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-create + * @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; + + /** + * Updates the socket properties. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-update + * @param socketId The socket ID. + * @param properties The properties to update. + * @param callback Called when the properties are updated. + */ + export function update(socketId: number, properties: SocketProperties, callback?: () => void): void; + + /** + * Pauses or unpauses a socket. A paused socket is blocked from firing + * onReceive events. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-setPaused + * @param socketId The socket ID. + * @param paused Flag to indicate whether to pause or unpause. + * @param callback Called when the socket has been successfully paused or + * unpaused. + */ + export function setPaused(socketId: number, paused: boolean, callback?: () => void): void; + + /** + * Binds the local address and port for the socket. For a client socket, it + * is recommended to use port 0 to let the platform pick a free port. + * + * Once the bind operation completes successfully, onReceive events are + * raised when UDP packets arrive on the address/port specified -- unless + * the socket is paused. + * + * @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 + * from all local available network interfaces. + * @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; + + /** + * Sends data on the given socket to the given address and port. The socket + * must be bound to a local port before calling this method. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-send + * @param socketId The socket ID. + * @param data The data to send. + * @param address The address of the remote machine. + * @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; + + /** + * Closes the socket and releases the address/port the socket is bound to. + * 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. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-close + * @param socketId The socket ID. + * @param callback Called when the close operation completes. + */ + export function close(socketId: number, callback?: () => void): void; + + /** + * Retrieves the state of the given socket. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-getInfo + * @param socketId The socket ID. + * @param callback Called when the socket state is available. + */ + export function getInfo(socketId: number, callback: (socketInfo: SocketInfo) => void): void; + + /** + * Retrieves the list of currently opened sockets owned by the application. + * + * @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; + + /** + * Joins the multicast group and starts to receive packets from that group. + * The socket must be bound to a local port before calling this method. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-joinGroup + * @param socketId The socket ID. + * @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; + + /** + * Leaves the multicast group previously joined using joinGroup. This is + * only necessary to call if you plan to keep using the socket afterwards, + * since it will be done automatically by the OS when the socket is closed. + * + * Leaving the group will prevent the router from sending multicast + * datagrams to the local host, presuming no other process on the host is + * still joined to the group. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-leaveGroup + * @param socketId The socket ID. + * @param address The group address to leave. Domain names are not + * supported. + * @param callback Called when the leaveGroup operation completes. + */ + export function leaveGroup(socketId: number, address: string, callback: (result: number) => void): void; + + /** + * Sets the time-to-live of multicast packets sent to the multicast group. + * + * Calling this method does not require multicast permissions. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-setMulticastTimeToLive + * @param socketId The socket ID. + * @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; + + /** + * Sets whether multicast packets sent from the host to the multicast group + * will be looped back to the host. + * + * Note: the behavior of setMulticastLoopbackMode is slightly different + * between Windows and Unix-like systems. The inconsistency happens only + * 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 + * applications with loopback off will not SEND the loopback packets to + * other applications on the same host. + * @see MSDN: http://goo.gl/6vqbj + * + * Calling this method does not require multicast permissions. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-setMulticastLoopbackMode + * @param socketId The socket ID. + * @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; + + /** + * Gets the multicast group addresses the socket is currently joined to. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-getJoinedGroups + * @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; + + /** + * Enables or disables broadcast packets on this socket. + * + * @since Chrome 44 + * @see https://developer.chrome.com/apps/sockets_udp#method-setBroadcast + * @param socketId The socket ID. + * @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; + + /** + * 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>; + + /** + * Event raised when a network error occured while the runtime was waiting + * for data on the socket address and port. Once this event is raised, the + * socket is paused and no more onReceive events will be raised for this + * socket until the socket is resumed. + * + * @see https://developer.chrome.com/apps/sockets_udp#event-onReceiveError + */ + export var onReceiveError: chrome.events.Event<(args: ReceiveErrorEventArgs) => void>; + } + + //////////////////// + // Storage + //////////////////// + /** + * Use the chrome.storage API to store, retrieve, and track changes to user data. + * Permissions: "storage" + * @since Chrome 20. + */ + namespace storage { + interface StorageArea { + /** + * Gets the amount of space (in bytes) being used by one or more items. + * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). + * Parameter bytesInUse: Amount of space being used in storage, in bytes. + */ + getBytesInUse(callback: (bytesInUse: number) => void): void; + /** + * Gets the amount of space (in bytes) being used by one or more items. + * @param keys A single key or list of keys to get the total usage for. An empty list will return 0. Pass in null to get the total usage of all of storage. + * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). + * Parameter bytesInUse: Amount of space being used in storage, in bytes. + */ + getBytesInUse(keys: string | string[] | null, callback: (bytesInUse: number) => void): void; + /** + * Removes all items from storage. + * @param callback Optional. + * Callback on success, or on failure (in which case runtime.lastError will be set). + */ + clear(callback?: () => void): void; + /** + * 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). + * @param callback Optional. + * Callback on success, or on failure (in which case runtime.lastError will be set). + */ + set(items: Object, callback?: () => void): void; + /** + * Removes one or more items from storage. + * @param A single key or a list of keys for items to remove. + * @param callback Optional. + * Callback on success, or on failure (in which case runtime.lastError will be set). + */ + remove(keys: string | string[], callback?: () => void): void; + /** + * Gets one or more items from storage. + * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). + * Parameter items: Object with items in their key-value mappings. + */ + get(callback: (items: { [key: string]: any }) => void): void; + /** + * Gets one or more items from storage. + * @param keys A single key to get, list of keys to get, or a dictionary specifying default values. + * An empty list or object will return an empty result object. Pass in null to get the entire contents of storage. + * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). + * Parameter items: Object with items in their key-value mappings. + */ + get(keys: string | string[] | Object | null, callback: (items: { [key: string]: any }) => void): void; + } + + interface StorageChange { + /** Optional. 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. */ + oldValue?: any; + } + + interface LocalStorageArea extends StorageArea { + /** The maximum amount (in bytes) of data that can be stored in local storage, as measured by the JSON stringification of every value plus every key's length. This value will be ignored if the extension has the unlimitedStorage permission. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */ + QUOTA_BYTES: number; + } + + interface SyncStorageArea extends StorageArea { + /** @deprecated since Chrome 40. The storage.sync API no longer has a sustained write operation quota. */ + MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: number; + /** The maximum total amount (in bytes) of data that can be stored in sync storage, as measured by the JSON stringification of every value plus every key's length. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */ + QUOTA_BYTES: number; + /** The maximum size (in bytes) of each individual item in sync storage, as measured by the JSON stringification of its value plus its key length. Updates containing items larger than this limit will fail immediately and set runtime.lastError. */ + QUOTA_BYTES_PER_ITEM: number; + /** The maximum number of items that can be stored in sync storage. Updates that would cause this limit to be exceeded will fail immediately and set runtime.lastError. */ + MAX_ITEMS: number; + /** + * The maximum number of set, remove, or clear operations that can be performed each hour. This is 1 every 2 seconds, a lower ceiling than the short term higher writes-per-minute limit. + * Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. + */ + MAX_WRITE_OPERATIONS_PER_HOUR: number; + /** + * The maximum number of set, remove, or clear operations that can be performed each minute. This is 2 per second, providing higher throughput than writes-per-hour over a shorter period of time. + * Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. + * @since Chrome 40. + */ + MAX_WRITE_OPERATIONS_PER_MINUTE: number; + } + + 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; + /** Items in the sync storage area are synced using Chrome Sync. */ + export var 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; + + /** Fired when one or more items change. */ + export var 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. + * @since Chrome 27 + */ + namespace syncFileSystem { + /** NOT YET IMPLEMENTED */ + } + + + //////////////////// + // System CPU + //////////////////// + /** + * Use the system.cpu API to query CPU metadata. + * Permissions: "system.cpu" + * @since Chrome 32. + */ + namespace system.cpu { + interface ProcessorUsage { + /** The cumulative time used by userspace programs on this processor. */ + user: number; + /** The cumulative time used by kernel programs on this processor. */ + kernel: number; + /** The cumulative time spent idle by this processor. */ + idle: number; + /** The total cumulative time for this processor. This value is equal to user + kernel + idle. */ + total: number; + } + + interface ProcessorInfo { + /** Cumulative usage info for this logical processor. */ + usage: ProcessorUsage; + } + + interface CpuInfo { + /** The number of logical processors. */ + numOfProcessors: number; + /** The architecture name of the processors. */ + archName: string; + /** The model name of the processors. */ + 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". + */ + features: string[]; + /** Information about each logical processor. */ + processors: ProcessorInfo[]; + } + + /** Queries basic CPU information of the system. */ + export function getInfo(callback: (info: CpuInfo) => void): void; + } + + //////////////////// + // System Display + //////////////////// + /** + * Use the system.display API to query display metadata. + * Permissions: "system.display" + * @since Chrome 30. + */ + namespace system.display { + interface Bounds { + /** The x-coordinate of the upper-left corner. */ + left: number; + /** The y-coordinate of the upper-left corner. */ + top: number; + /** The width of the display in pixels. */ + width: number; + /** The height of the display in pixels. */ + height: number; + } + + interface Insets { + /** The x-axis distance from the left bound. */ + left: number; + /** The y-axis distance from the top bound. */ + top: number; + /** The x-axis distance from the right bound. */ + right: number; + /** The y-axis distance from the bottom bound. */ + bottom: number; + } + + /** + * @since Chrome 57 + */ + interface Point { + /** The x-coordinate of the point. */ + x: number; + /** The y-coordinate of the point. */ + y: number; + } + + /** + * @since Chrome 57 + */ + interface TouchCalibrationPair { + /** The coordinates of the display point. */ + displayPoint: Point; + /** The coordinates of the touch point corresponding to the display point. */ + touchPoint: Point; + } + + /** + * @since Chrome 52 + */ + interface DisplayMode { + /** The display mode width in device independent (user visible) pixels. */ + width: number; + + /** The display mode height in device independent (user visible) pixels. */ + height: number; + + /** The display mode width in native pixels. */ + widthInNativePixels: number; + + /** The display mode height in native pixels. */ + heightInNativePixels: number; + + /** The display mode UI scale factor. */ + uiScale: number; + + /** The display mode device scale factor. */ + deviceScaleFactor: number; + + /** True if the mode is the display's native mode. */ + isNative: boolean; + + /** True if the display mode is currently selected. */ + isSelected: boolean; + } + + /** + * @since Chrome 53 + */ + interface DisplayLayout { + /** The unique identifier of the display. */ + id: string; + /** 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'; + /** 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. + * @export + * @interface TouchCalibrationPairs + */ + interface TouchCalibrationPairs { + /** First pair of touch and display point required for touch calibration. */ + pair1: TouchCalibrationPair, + /** Second pair of touch and display point required for touch calibration. */ + pair2: TouchCalibrationPair, + /** Third pair of touch and display point required for touch calibration. */ + pair3: TouchCalibrationPair, + /** Fourth pair of touch and display point required for touch calibration. */ + pair4: TouchCalibrationPair + } + + /** + * @description 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. + * @since Chrome 59 + * */ + isUnified?: boolean; + + /** + * Chrome OS only. If set and not empty, enables mirroring for this display. Otherwise disables mirroring for this display. This value should indicate the id of the source display to mirror, which must not be the same as the id passed to setDisplayProperties. If set, no other property may be set. + */ + mirroringSourceId?: string; + + /** If set to true, makes the display primary. No-op if set to false. */ + isPrimary?: boolean; + + /** If set, sets the display's overscan insets to the provided values. Note that overscan values may not be negative or larger than a half of the screen's size. Overscan cannot be changed on the internal monitor. It's applied after isPrimary parameter. */ + overscan?: Insets; + + /** If set, updates the display's rotation. Legal values are [0, 90, 180, 270]. The rotation is set clockwise, relative to the display's vertical position. It's applied after overscan paramter. */ + rotation?: 0 | 90 | 180 | 270; + + /** If set, updates the display's logical bounds origin along x-axis. Applied together with boundsOriginY, if boundsOriginY is set. Note that, when updating the display origin, some constraints will be applied, so the final bounds origin may be different than the one set. The final bounds can be retrieved using getInfo. The bounds origin is applied after rotation. The bounds origin cannot be changed on the primary display. Note that is also invalid to set bounds origin values if isPrimary is also set (as isPrimary parameter is applied first). */ + boundsOriginX?: number; + + /** If set, updates the display's logical bounds origin along y-axis. See documentation for boundsOriginX parameter. */ + boundsOriginY: number; + + /** + * @since Chrome 52 + * @description If set, updates the display mode to the mode matching this value. + */ + displayMode?: DisplayMode; + } + + /** + * @description 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. + * @type {boolean} + * @memberof DisplayInfoFlags + */ + singleUnified?: boolean; + } + + /** Information about display properties. */ + interface DisplayInfo { + /** The unique identifier of the display. */ + id: string; + /** 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; + /** True if this is the primary display. */ + isPrimary: boolean; + /** True if this is an internal display. */ + isInternal: boolean; + /** True if this display is enabled. */ + isEnabled: boolean; + /** The number of pixels per inch along the x-axis. */ + dpiX: number; + /** The number of pixels per inch along the y-axis. */ + dpiY: number; + /** The display's clockwise rotation in degrees relative to the vertical position. Currently exposed only on ChromeOS. Will be set to 0 on other platforms. */ + rotation: number; + /** The display's logical bounds. */ + bounds: Bounds; + /** The display's insets within its screen's bounds. Currently exposed only on ChromeOS. Will be set to empty insets on other platforms. */ + overscan: Insets; + /** The usable work area of the display within the display bounds. The work area excludes areas of the display reserved for OS, for example taskbar and launcher. */ + workArea: Bounds; + } + + /** 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|. */ + interface DisplayProps { + /** If set and not empty, starts mirroring between this and the display with the provided id (the system will determine which of the displays is actually mirrored). If set and not empty, stops mirroring between this and the display with the specified id (if mirroring is in progress). If set, no other parameter may be set. */ + mirroringSourceId?: string; + /** If set to true, makes the display primary. No-op if set to false. */ + isPrimary?: boolean; + /** If set, sets the display's overscan insets to the provided values. Note that overscan values may not be negative or larger than a half of the screen's size. Overscan cannot be changed on the internal monitor. It's applied after isPrimary parameter. */ + overscan?: Insets; + /** If set, updates the display's rotation. Legal values are [0, 90, 180, 270]. The rotation is set clockwise, relative to the display's vertical position. It's applied after overscan paramter. */ + rotation?: number; + /** If set, updates the display's logical bounds origin along x-axis. Applied together with boundsOriginY, if boundsOriginY is set. Note that, when updating the display origin, some constraints will be applied, so the final bounds origin may be different than the one set. The final bounds can be retrieved using getInfo. The bounds origin is applied after rotation. The bounds origin cannot be changed on the primary display. Note that is also invalid to set bounds origin values if isPrimary is also set (as isPrimary parameter is applied first). */ + boundsOriginX?: number; + /** If set, updates the display's logical bounds origin along y-axis. See documentation for boundsOriginX parameter. */ + boundsOriginY?: number; + } + + /** + * @description Fired when anything changes to the display configuration. + * @export + * @interface DisplayChangedEvent + * @extends {chrome.events.Event<() => void>} + */ + interface DisplayChangedEvent extends chrome.events.Event<() => void> { } + + /** + * @description 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; + /** + * @description 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; + + /** + * @description 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; + + /** + * @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. + * @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; + + /** + * @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. + * @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; + + /** + * @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. + * @since Chrome 46 + * @export + * @param {boolean} enabled True if unified desktop should be enabled. + */ + export 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. + * @since Chrome 53 + * @export + * @param {string} id The display's unique identifier. + */ + export 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. + * @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; + + /** + * @description 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; + + /** + * @description 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; + + /** + * @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. + * @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; + + /** + * @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. + * @since Chrome 57 + * @export + * @param {string} id The display's unique identifier. + */ + export 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. + * @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; + /** + * @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. + * @since Chrome 57 + * @export + * @param {string} id The display's unique identifier. + */ + export function clearTouchCalibration(id: string): void; + + /** + * @description Fired when anything changes to the display configuration. + * @export + */ + export var onDisplayChanged: DisplayChangedEvent; + } + + //////////////////// + // System Memory + //////////////////// + /** + * The chrome.system.memory API. + * Permissions: "system.memory" + * @since Chrome 32. + */ + namespace system.memory { + interface MemoryInfo { + /** The total amount of physical memory capacity, in bytes. */ + capacity: number; + /** The amount of available capacity, in bytes. */ + availableCapacity: number; + } + + /** Get physical memory information. */ + export function getInfo(callback: (info: MemoryInfo) => void): void; + } + + //////////////////// + // System - Network + //////////////////// + namespace system.network { + interface NetworkInterface { + name: string; + address: string; + prefixLength: number; + } + + export function getNetworkInterfaces(callback: (networkInterfaces: NetworkInterface[]) => void): void; + } + + //////////////////// + // System Storage + //////////////////// + /** + * 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" + * @since Chrome 30. + */ + namespace system.storage { + interface StorageUnitInfo { + /** The transient ID that uniquely identifies the storage device. This ID will be persistent within the same run of a single application. It will not be a persistent identifier between different runs of an application, or between different applications. */ + id: string; + /** The name of the storage unit. */ + name: string; + /** + * The media type of the storage unit. + * fixed: The storage has fixed media, e.g. hard disk or SSD. + * removable: The storage is removable, e.g. USB flash drive. + * unknown: The storage type is unknown. + */ + type: string; + /** The total amount of the storage space, in bytes. */ + capacity: number; + } + + interface StorageCapacityInfo { + /** A copied |id| of getAvailableCapacity function parameter |id|. */ + id: string; + /** The available capacity of the storage device, in bytes. */ + availableCapacity: number; + } + + interface SystemStorageAttachedEvent extends chrome.events.Event<(info: StorageUnitInfo) => void> { } + + 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; + /** + * 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; + /** + * 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; + + /** Fired when a new removable storage is attached to the system. */ + export var onAttached: SystemStorageAttachedEvent; + /** Fired when a removable storage is detached from the system. */ + export var onDetached: SystemStorageDetachedEvent; + } + + //////////////////// + // Text to Speech + //////////////////// + /** + * 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" + * @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. */ + charIndex?: number; + /** Optional. 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" + */ + 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'. */ + lang?: string; + /** + * Optional. This voice's gender. + * One of: "male", or "female" + */ + gender?: string; + /** Optional. The name of the voice. */ + voiceName?: string; + /** The ID of the extension providing this voice. */ + extensionsId?: string; + /** All of the callback event types that this voice is capable of sending. */ + eventTypes?: string[]; + /** + * If true, the synthesis engine is a remote network resource. It may be higher latency and may incur bandwidth costs. + * @since Chrome 33. + */ + remote?: boolean; + } + + interface SpeakOptions { + /** Optional. Speaking volume between 0 and 1 inclusive, with 0 being lowest and 1 being highest, with a default of 1.0. */ + volume?: number; + /** + * Optional. + * If true, enqueues this utterance if TTS is already in progress. If false (the default), interrupts any current speech and flushes the speech queue before speaking this new utterance. + */ + enqueue?: boolean; + /** + * Optional. + * Speaking rate relative to the default rate for this voice. 1.0 is the default rate, normally around 180 to 220 words per minute. 2.0 is twice as fast, and 0.5 is half as fast. Values below 0.1 or above 10.0 are strictly disallowed, but many voices will constrain the minimum and maximum rates further—for example a particular voice may not actually speak faster than 3 times normal even if you specify a value larger than 3.0. + */ + rate?: number; + /** + * Optional. 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; + /** + * Optional. + * 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'. */ + lang?: string; + /** Optional. 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. */ + extensionId?: string; + /** + * Optional. Gender of voice for synthesized speech. + * One of: "male", or "female" + */ + gender?: string; + /** Optional. 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. */ + 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; + /** 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; + /** Gets an array of all available voices. */ + export 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. + */ + export 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. + */ + export 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; + /** + * If speech was paused, resumes speaking where it left off. + * @since Chrome 29. + */ + export function resume(): void; + } + + //////////////////// + // Types + //////////////////// + /** + * The chrome.types API contains type declarations for Chrome. + * @since Chrome 13. + */ + namespace types { + interface ChromeSettingClearDetails { + /** + * Optional. + * 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; + } + + interface ChromeSettingSetDetails extends ChromeSettingClearDetails { + /** + * The value of the setting. + * Note that every setting has a specific value type, which is described together with the setting. An extension should not set a value of a different type. + */ + value: any; + /** + * Optional. + * 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; + } + + interface ChromeSettingGetDetails { + /** Optional. 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; + + interface ChromeSettingGetResultDetails { + /** + * One of + * • not_controllable: cannot be controlled by any extension + * • controlled_by_other_extensions: controlled by extensions with higher precedence + * • controllable_by_this_extension: can be controlled by this extension + * • controlled_by_this_extension: controlled by this extension + */ + levelOfControl: string; + /** The value of the setting. */ + value: any; + /** + * 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. + */ + incognitoSpecific?: boolean; + } + + interface ChromeSettingChangedEvent extends chrome.events.Event { } + + /** An interface that allows access to a Chrome browser setting. See accessibilityFeatures for an example. */ + interface ChromeSetting { + /** + * Sets the value of a setting. + * @param details Which setting to change. + * @param callback Optional. Called at the completion of the set operation. + */ + set(details: ChromeSettingSetDetails, callback?: Function): void; + /** + * Gets the value of a setting. + * @param details Which setting to consider. + */ + get(details: ChromeSettingGetDetails, callback?: DetailsCallback): void; + /** + * Clears the setting, restoring any default value. + * @param details Which setting to clear. + * @param callback Optional. Called at the completion of the clear operation. + */ + clear(details: ChromeSettingClearDetails, callback?: Function): void; + /** Fired after the setting changes. */ + onChange: ChromeSettingChangedEvent; + } + } + + //////////////////// + // USB + //////////////////// + namespace usb { + type Direction = 'in' | 'out'; + + interface Device { + device: number, + vendorId: number, + productId: number, + productName: string, + manufacturerName: string, + serialNumber: string + } + + interface ConnectionHandle { + handle: number, + vendorId: number, + productId: number + } + + interface EndpointDescriptor { + address: number, + type: 'control' | 'interrupt' | 'isochronous' | 'bulk', + direction: Direction, + maximumPacketSize: number, + synchronization?: 'asynchronous' | 'adaptive' | 'synchronous', + usage?: 'data' | 'feedback' | 'explicitFeedback', + pollingInterval?: number, + extra_data: ArrayBuffer + } + + interface InterfaceDescriptor { + interfaceNumber: number, + alternateSetting: number, + interfaceClass: number, + interfaceSubclass: number, + interfaceProtocol: number, + description?: string, + endpoints: EndpointDescriptor[], + extra_data: ArrayBuffer + } + + interface ConfigDescriptor { + active: boolean, + configurationValue: number, + description?: string, + selfPowered: boolean, + remoteWakeup: boolean, + maxPower: number, + interfaces: InterfaceDescriptor[], + extra_data: ArrayBuffer + } + + interface GenericTransferInfo { + direction: Direction, + endpoint: number, + length?: number, + data?: ArrayBuffer, + timeout?: number + } + + interface TransferResultInfo { + resultCode: number, + data?: ArrayBuffer + } + + interface DeviceFilter { + vendorId?: number, + productId?: number, + interfaceClass?: number, + interfaceSubclass?: number, + interfaceProtocol?: number + } + + interface TransferInfo { + direction: Direction; + recipient: 'device' | 'interface' | 'endpoint' | 'other'; + requestType: 'standard' | 'class' | 'vendor' | 'reserved'; + request: number; + value: number; + index: number; + length?: number; + data?: ArrayBuffer; + timeout?: number; + } + + interface DeviceEvent extends chrome.events.Event<(device: Device) => void> { } + + export var onDeviceAdded: DeviceEvent; + export var 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; + } + + + //////////////////// + // VPN Provider + //////////////////// + /** + * Use the chrome.vpnProvider API to implement a VPN client. + * Permissions: "vpnProvider" + * Important: This API works only on Chrome OS. + * @since Chrome 43. + */ + namespace vpnProvider { + 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) */ + broadcastAddress?: string; + /** Optional. 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. + */ + inclusionList: string[]; + /** Optional. A list of search domains. (default: no search domain) */ + domainSearch?: string[]; + /** A list of IPs for the DNS servers. */ + dnsServer: string[]; + } + + interface VpnPlatformMessageEvent extends chrome.events.Event<(id: string, message: string, error: string) => void> { } + + interface VpnPacketReceptionEvent extends chrome.events.Event<(data: ArrayBuffer) => void> { } + + interface VpnConfigRemovalEvent extends chrome.events.Event<(id: string) => void> { } + + interface VpnConfigCreationEvent extends chrome.events.Event<(id: string, name: string, data: Object) => void> { } + + interface VpnUiEvent extends chrome.events.Event<(event: string, id?: string) => void> { } + + /** + * Creates a new VPN configuration that persists across multiple login sessions of the user. + * @param name The name of the VPN configuration. + * @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; + /** + * 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. + */ + export 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. + * @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; + /** + * 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. + */ + export 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. + */ + export 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; + /** Triggered when an IP packet is received via the tunnel for the VPN session owned by the extension. */ + export var onPacketReceived: VpnPacketReceptionEvent; + /** Triggered when a configuration created by the extension is removed by the platform. */ + export var onConfigRemoved: VpnConfigRemovalEvent; + /** Triggered when a configuration is created by the platform for the extension. */ + export var 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; + } + + //////////////////// + // Wallpaper + //////////////////// + /** + * Use the chrome.wallpaper API to change the ChromeOS wallpaper. + * Permissions: "wallpaper" + * Important: This API works only on Chrome OS. + * @since Chrome 43. + */ + namespace wallpaper { + interface WallpaperDetails { + /** Optional. The jpeg or png encoded wallpaper image. */ + data?: any; + /** Optional. The URL of the wallpaper to be set. */ + url?: string; + /** + * The supported wallpaper layouts. + * One of: "STRETCH", "CENTER", or "CENTER_CROPPED" + */ + layout: string; + /** The file name of the saved wallpaper. */ + filename: string; + /** Optional. 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. + */ + export function setWallpaper(details: WallpaperDetails, callback: (thumbnail: any) => void): void; + } + + + /////////////////// + // 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). + */ + namespace webview { + /** 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). */ + 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 + */ + level: number; + /** + * @description The logged message contents. + * @type {string} + * @memberof ConsoleEvent + */ + message: string; + /** + * @description The line number of the message source. + * @type {number} + * @memberof ConsoleEvent + */ + line: number; + /** + * @description A string identifying the resource which logged the message. + * @type {string} + * @memberof ConsoleEvent + */ + sourceId: string; + } + + interface ExitEvent extends Event { + /** + * @description Chrome's internal ID of the process that exited. + * @type {number} + * @memberof ExitEvent + */ + processID: number; + /** + * @description String indicating the reason for the exit. + * @type {string} + * @memberof ExitEvent + */ + reason: 'normal' | 'abnormal' | 'crash' | 'kill'; + } + + /** Description of a declarative rule for handling events. */ + interface Rule { + /** 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. */ + 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.¨ + * @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 + */ + 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 + */ + code?: string, + /** + * @description JavaScript or CSS file to inject. + * @type {string} + * @memberof InjectDetails + */ + 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} + */ + interface HTMLWebViewElement extends Element { + executeScript?: (details: InjectDetails, callback?: (result: any) => void) => void; + src: string; + contentWindow: Window; + addEventListener(type: K, listener: (this: HTMLWebViewElement, ev: WebViewElementEventMap[K]) => any, useCapture?: boolean): void; + } + + /**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). + */ + since?: number; + } + /**A set of data types. Missing properties are interpreted as false. */ + interface ClearDataTypeSet { + + /** + * @description Websites' appcaches. + */ + 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 + } + /** + * 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. */ + 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. + */ + code?: string + + /** + * @description JavaScript or CSS file to inject. + */ + file?: string + } + /**The type of injection item: code or a set of files. */ + interface InjectionItems { + + /** + * @description 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. + */ + files?: any[] + } + /**Details of the content script to inject. Refer to the content scripts documentation for more details. */ + interface ContentScriptDetails { + + /** + * @description The name of the content script to inject. + */ + name: string + + /** + * @description Specifies which pages this content script will be injected into. + */ + matches: any[] + + /** + * @description 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. + */ + 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. + */ + 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. + */ + js?: InjectionItems + + /** + * @description 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. + */ + all_frames?: boolean; + + /** + * @description 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. + */ + exclude_globs?: string[]; + } + /**@todo Add documentation */ + interface ContextMenuCreateProperties { + + /** + * @description The type of menu item. Defaults to 'normal' if not specified. + */ + 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. + */ + 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". + */ + 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. + */ + checked?: boolean + + /** + * @description List of contexts this menu item will appear in. Defaults to ['page'] if not specified. + */ + contexts?: any[] + + /** + * @description A function that will be called back when the menu item is clicked. + * @param {any} [object Object] + */ + onclick?: (info: any) => void + + /** + * @description The ID of a parent menu item; this makes the item a child of a previously added item. + */ + 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. + */ + 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. + */ + targetUrlPatterns?: any[] + + /** + * @description Whether this context menu item is enabled or disabled. Defaults to true. + */ + enabled?: boolean + } + /**@todo Add documentation */ + interface ContextMenuUpdateProperties { + + /** + * @description The type of menu item. + */ + type?: chrome.webview.ContextType; + + /** + * @description 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. + */ + checked?: boolean + + /** + * @description List of contexts this menu item will appear in. + */ + contexts?: any[] + + /** + * @description A function that will be called back when the menu item is clicked. + * @param {any} [object Object] + */ + 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. + */ + 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. + */ + 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. + */ + targetUrlPatterns?: any[] + + /** + * @description Whether this context menu item is enabled or disabled. + */ + 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] + */ + 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] + */ + update(id: number | 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] + */ + remove(menuItemId: number | string, callback?: () => void): void; + + /** + * @description Removes all context menu items added to this webview. + * @param {any} [object Object] + */ + 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(). + */ + onShow: chrome.events.Event; + + } + interface IOnShowEvent { + /** + * @description Call this to prevent showing the context menu. + * @memberof IOnShowEvent + */ + 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. + */ + 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. + */ + ok(response?: string): void; + + /** + * @description Reject the dialog. Equivalent to clicking Cancel in a confirm or prompt dialog. + */ + cancel(): void; + + } + /**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 + } + /**Options for the find request. */ + interface FindOptions { + + /** + * @description Flag to find matches in reverse order. The default value is false. + */ + backward?: boolean + + /** + * @description Flag to match with case-sensitivity. The default value is false. + */ + 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(webview: object): void; + + /** + * @description Cancel the new window request. + */ + discard(): void; + + } + interface MediaPermissionRequest { + + /** + * @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 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.

*/ + 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 + } + /**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 WebRequestEventInterface { + } + /** + * 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 { + + /** + * @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. + */ + 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 + } + /**IDialog (Auto generated interface) */ + interface IDialog { + + /** + * @description The type of modal dialog requested by the guest. + */ + messageType: 'alert' | 'confirm' | 'prompt' + + /** + * @description The text the guest attempted to display in the modal dialog. + */ + messageText: string + + /** + * @description An interface that can be used to respond to the guest's modal request. + */ + 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' + } + /**IFindupdate (Auto generated interface) */ + interface IFindupdate { + + /** + * @description The string that is being searched for in the page. + */ + searchText: string + + /** + * @description The number of matches found for searchText on the page so far. + */ + numberOfMatches: number + + /** + * @description The ordinal number of the current active match, if it has been found. This will be 0 until then. + */ + activeMatchOrdinal: number + + /** + * @description Describes a rectangle around the active match, if it has been found, in screen coordinates. + */ + selectionRect: SelectionRect + + /** + * @description Indicates whether the find request was canceled. + */ + 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. + */ + finalUpdate: string + } + /**ILoadabort (Auto generated interface) */ + interface ILoadabort { + + /** + * @description Requested URL. + */ + url: string + + /** + * @description Whether the load was top-level or in a subframe. + */ + 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' + } + /**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 + } + /**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 + } + /**ILoadstart (Auto generated interface) */ + interface ILoadstart { + + /** + * @description Requested URL. + */ + url: string + + /** + * @description Whether the load is top-level or in a subframe. + */ + isTopLevel: boolean + } + /**INewwindow (Auto generated interface) */ + interface INewwindow { + + /** + * @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 + + /** + * @description The target URL requested for the new window. + */ + targetUrl: string + + /** + * @description The initial width requested for the new window. + */ + initialWidth: number + + /** + * @description The initial height requested for the new window. + */ + initialHeight: number + + /** + * @description 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' + } + /**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 + } + /**IResponsive (Auto generated interface) */ + interface IResponsive { + + /** + * @description 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 + } + /**IUnresponsive (Auto generated interface) */ + interface IUnresponsive { + + /** + * @description 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 + } + + } + +} + +///////////////////// +// EXPORT +///////////////////// +interface Window { + chrome: typeof chrome; +} diff --git a/types/chrome/test/chrome-app.ts b/types/chrome-apps/test/index.ts similarity index 97% rename from types/chrome/test/chrome-app.ts rename to types/chrome-apps/test/index.ts index 6dbd06d9e2..f976fc57b4 100644 --- a/types/chrome/test/chrome-app.ts +++ b/types/chrome-apps/test/index.ts @@ -1,5 +1,3 @@ - - import runtime = chrome.app.runtime; import cwindow = chrome.app.window; @@ -44,7 +42,7 @@ 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", @@ -58,13 +56,13 @@ function test_fileSystem(): void { var retainedId = chrome.fileSystem.retainEntry(entry); chrome.fileSystem.isRestorable(retainedId, (isRestorable: boolean) => { - if(isRestorable){ + if (isRestorable) { chrome.fileSystem.restoreEntry(retainedId, (restoredEntry: Entry) => { }); } }); - chrome.fileSystem.getWritableEntry(entry, (writableEntry: Entry) => {}); - chrome.fileSystem.isWritableEntry(entry, (isWritable: boolean) => {}); + chrome.fileSystem.getWritableEntry(entry, (writableEntry: Entry) => { }); + chrome.fileSystem.isWritableEntry(entry, (isWritable: boolean) => { }); }); } @@ -325,3 +323,6 @@ function testSystemNetwork() { } }); } + +import webview = chrome.webview; +let element: webview.HTMLWebViewElement; diff --git a/types/chrome-apps/tsconfig.json b/types/chrome-apps/tsconfig.json new file mode 100644 index 0000000000..50a50c3193 --- /dev/null +++ b/types/chrome-apps/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es2017", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "test/index.ts" + ] +} diff --git a/types/ids/tslint.json b/types/chrome-apps/tslint.json similarity index 100% rename from types/ids/tslint.json rename to types/chrome-apps/tslint.json diff --git a/types/chrome/chrome-app.d.ts b/types/chrome/chrome-app.d.ts deleted file mode 100644 index 65d80f3290..0000000000 --- a/types/chrome/chrome-app.d.ts +++ /dev/null @@ -1,1503 +0,0 @@ -// Type definitions for Chrome packaged application development -// Project: http://developer.chrome.com/apps/ -// Definitions by: Adam Lay , MIZUNE Pine , MIZUSHIMA Junki , Ingvar Stepanyan , Adam Pyle , Nikolai Ommundsen -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// -/// - -//////////////////// -// App -//////////////////// -declare namespace chrome.app { - export interface AppDetails extends chrome.runtime.Manifest { - id: string; - } - - export function getDetails(): AppDetails; -} - -//////////////////// -// App Runtime -//////////////////// -declare namespace chrome.app.runtime { - enum LaunchSource { - "untracked" = "untracked", - "app_launcher" = "app_launcher", - "new_tab_page" = "new_tab_page", - "reload" = "reload", - "restart" = "restart", - "load_and_launch" = "load_and_launch", - "command_line" = "command_line", - "file_handler" = "file_handler", - "url_handler" = "url_handler", - "system_tray" = "system_tray", - "about_page" = "about_page", - "keyboard" = "keyboard", - "extensions_page" = "extensions_page", - "management_api" = "management_api", - "ephemeral_app" = "ephemeral_app", - "background" = "background", - "kiosk" = "kiosk", - "chrome_internal" = "chrome_internal", - "test" = "test", - "installed_notification" = "installed_notification", - "context_menu" = "context_menu", - } - - interface LaunchData { - id?: string; - items?: LaunchDataItem[]; - url?: string; - referrerUrl?: string; - isKioskSession?: boolean; - isPublicSession?: boolean; - source?: LaunchSource; - actionData?: {}; - } - - export interface LaunchDataItem { - entry: FileEntry; - type: string; - } - - export interface LaunchedEvent extends chrome.events.Event<(launchData: LaunchData) => void> { } - - export interface RestartedEvent extends chrome.events.Event<() => void> { } - - export var onLaunched: LaunchedEvent; - export var onRestarted: RestartedEvent; -} - -//////////////////// -// App Window -//////////////////// -declare namespace chrome.app.window { - export interface ContentBounds { - left?: number; - top?: number; - width?: number; - height?: number; - } - - export interface BoundsSpecification { - left?: number; - top?: number; - width?: number; - height?: number; - minWidth?: number; - minHeight?: number; - maxWidth?: number; - maxHeight?: number; - } - - export interface Bounds { - left: number; - top: number; - width: number; - height: number; - minWidth?: number; - minHeight?: number; - maxWidth?: number; - maxHeight?: number; - setPosition(left: number, top: number): void; - setSize(width: number, height: number): void; - setMinimumSize(minWidth: number, minHeight: number): void; - setMaximumSize(maxWidth: number, maxHeight: number): void; - } - export interface FrameOptions { - type?: string; - color?: string; - activeColor?: string; - inactiveColor?: string; - } - - export interface CreateWindowOptions { - id?: string; - innerBounds?: BoundsSpecification; - outerBounds?: BoundsSpecification; - minWidth?: number; - minHeight?: number; - maxWidth?: number; - maxHeight?: number; - /** - * @description - * @type {(string | FrameOptions)} string ("none", "chrome") or FrameOptions - * @memberof CreateWindowOptions - */ - frame?: string | FrameOptions; - bounds?: ContentBounds; - alphaEnabled?: boolean; - /** - * @description - * @type {string} "normal", "fullscreen", "maximized", "minimized" - * @memberof CreateWindowOptions - */ - state?: string; - hidden?: boolean; - resizable?: boolean; - singleton?: boolean; - alwaysOnTop?: boolean; - focused?: boolean; - visibleOnAllWorkspaces?: boolean; - } - - export interface AppWindow { - focus: () => void; - fullscreen: () => void; - isFullscreen: () => boolean; - minimize: () => void; - isMinimized: () => boolean; - maximize: () => void; - isMaximized: () => boolean; - restore: () => void; - moveTo: (left: number, top: number) => void; - resizeTo: (width: number, height: number) => void; - drawAttention: () => void; - clearAttention: () => void; - close: () => void; - show: () => void; - hide: () => void; - getBounds: () => ContentBounds; - setBounds: (bounds: ContentBounds) => void; - isAlwaysOnTop: () => boolean; - setAlwaysOnTop: (alwaysOnTop: boolean) => void; - setVisibleOnAllWorkspaces: (alwaysVisible: boolean) => void; - contentWindow: Window; - id: string; - innerBounds: Bounds; - outerBounds: Bounds; - onBoundsChanged: WindowEvent; - onClosed: WindowEvent; - onFullscreened: WindowEvent; - onMaximized: WindowEvent; - onMinimized: WindowEvent; - 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; - - export 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; -} - -//////////////////// -// fileSystem -//////////////////// -declare namespace chrome.fileSystem { - - export interface AcceptOptions { - description?: string; - mimeTypes?: string[]; - extensions?: string[]; - } - - export interface ChooseEntryOptions { - type?: string; - suggestedName?: string; - accepts?: AcceptOptions[]; - acceptsAllTypes?: boolean; - 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; -} - -//////////////////// -// Media Galleries -//////////////////// -declare namespace chrome.mediaGalleries { - export interface MediaFileSystemsOptions { - interactive?: 'no' | 'yes' | 'if_needed'; - } - - export interface MediaFileSystemMetadata { - name: string; - galleryId: string; - deviceId?: string; - isRemovable: boolean; - isMediaDevice: boolean; - isAvailable: boolean; - } - - export interface MetadataOptions { - metadataType: 'all' | 'mimeTypeAndTags' | 'mimeTypeOnly'; - } - - export interface RawTag { - type: string; - tags: { [name: string]: string; }; - } - - export interface Metadata { - // 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. - album?: string; - artist?: string; - comment?: string; - copyright?: string; - disc?: number; - genre?: string; - 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. - rawTags: RawTag[]; - // The images embedded in the media file's metadata. This is most often used for album art or video thumbnails. - attachedImages: Blob[]; - } - - export interface GalleryWatchResult { - galleryId: string; - success: boolean; - } - - export interface GalleryChangedEventArgs { - type: 'contents_changed' | 'watch_dropped'; - galleryId: string; - } - - export 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; - } - - 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>; -} - -//////////////////// -// Sockets -//////////////////// -declare namespace chrome.sockets.tcp { - export interface CreateInfo { - socketId: number; - } - - export interface SendInfo { - resultCode: number; - bytesSent?: number; - } - - export interface ReceiveEventArgs { - socketId: number; - data: ArrayBuffer; - } - - export interface ReceiveErrorEventArgs { - socketId: number; - resultCode: number; - } - - export interface SocketProperties { - persistent?: boolean; - name?: string; - bufferSize?: number; - } - - export interface SocketInfo { - socketId: number; - persistent: boolean; - name?: string; - bufferSize?: number; - paused: boolean; - connected: boolean; - localAddress?: string; - localPort?: number; - peerAddress?: string; - peerPort?: number; - } - - export function create(callback: (createInfo: CreateInfo) => void): void; - export 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; - - export function setKeepAlive(socketId: number, - enable: boolean, callback: (result: number) => void): void; - export 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, - 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; - - export var onReceive: chrome.events.Event<(args: ReceiveEventArgs) => void>; - export var onReceiveError: chrome.events.Event<(args: ReceiveErrorEventArgs) => 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. - * - * @since Chrome 33 - * @see https://developer.chrome.com/apps/sockets_udp - */ -declare namespace chrome.sockets.udp { - export interface CreateInfo { - socketId: number; - } - - export interface SendInfo { - resultCode: number; - bytesSent?: number; - } - - export interface ReceiveEventArgs { - socketId: number; - data: ArrayBuffer; - remoteAddress: string; - remotePort: number; - } - - export interface ReceiveErrorEventArgs { - socketId: number; - resultCode: number; - } - - /** - * @see https://developer.chrome.com/apps/sockets_udp#type-SocketProperties - */ - export 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 loaded, any sockets previously opened with - * persistent=true can be fetched with getSockets. - * @see http://developer.chrome.com/apps/app_lifecycle.html - */ - persistent?: boolean; - - /** An application-defined string associated with the socket. */ - name?: string; - - /** - * 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. - */ - bufferSize?: number; - } - - /** - * @see https://developer.chrome.com/apps/sockets_udp#type-SocketInfo - */ - export interface SocketInfo { - /** The socket identifier. */ - socketId: number; - - /** - * Flag indicating whether the socket is left open when the application - * is suspended (see SocketProperties.persistent). - */ - persistent: boolean; - - /** Application-defined string associated with the socket. */ - name?: string; - - /** - * The size of the buffer used to receive data. If no buffer size ha - * been specified explictly, the value is not provided. - */ - bufferSize?: number; - - /** - * Flag indicating whether the socket is blocked from firing onReceive - * events. - */ - paused: boolean; - - /** - * If the underlying socket is bound, contains its local IPv4/6 address. - */ - localAddress?: string; - - /** - * If the underlying socket is bound, contains its local port. - */ - localPort?: number; - } - - /** - * Creates a UDP socket with default properties. - * - * @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; - - /** - * Creates a UDP socket with the given properties. - * - * @see https://developer.chrome.com/apps/sockets_udp#method-create - * @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; - - /** - * Updates the socket properties. - * - * @see https://developer.chrome.com/apps/sockets_udp#method-update - * @param socketId The socket ID. - * @param properties The properties to update. - * @param callback Called when the properties are updated. - */ - export function update(socketId: number, properties: SocketProperties, callback?: () => void): void; - - /** - * Pauses or unpauses a socket. A paused socket is blocked from firing - * onReceive events. - * - * @see https://developer.chrome.com/apps/sockets_udp#method-setPaused - * @param socketId The socket ID. - * @param paused Flag to indicate whether to pause or unpause. - * @param callback Called when the socket has been successfully paused or - * unpaused. - */ - export function setPaused(socketId: number, paused: boolean, callback?: () => void): void; - - /** - * Binds the local address and port for the socket. For a client socket, it - * is recommended to use port 0 to let the platform pick a free port. - * - * Once the bind operation completes successfully, onReceive events are - * raised when UDP packets arrive on the address/port specified -- unless - * the socket is paused. - * - * @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 - * from all local available network interfaces. - * @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; - - /** - * Sends data on the given socket to the given address and port. The socket - * must be bound to a local port before calling this method. - * - * @see https://developer.chrome.com/apps/sockets_udp#method-send - * @param socketId The socket ID. - * @param data The data to send. - * @param address The address of the remote machine. - * @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; - - /** - * Closes the socket and releases the address/port the socket is bound to. - * 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. - * - * @see https://developer.chrome.com/apps/sockets_udp#method-close - * @param socketId The socket ID. - * @param callback Called when the close operation completes. - */ - export function close(socketId: number, callback?: () => void): void; - - /** - * Retrieves the state of the given socket. - * - * @see https://developer.chrome.com/apps/sockets_udp#method-getInfo - * @param socketId The socket ID. - * @param callback Called when the socket state is available. - */ - export function getInfo(socketId: number, callback: (socketInfo: SocketInfo) => void): void; - - /** - * Retrieves the list of currently opened sockets owned by the application. - * - * @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; - - /** - * Joins the multicast group and starts to receive packets from that group. - * The socket must be bound to a local port before calling this method. - * - * @see https://developer.chrome.com/apps/sockets_udp#method-joinGroup - * @param socketId The socket ID. - * @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; - - /** - * Leaves the multicast group previously joined using joinGroup. This is - * only necessary to call if you plan to keep using the socket afterwards, - * since it will be done automatically by the OS when the socket is closed. - * - * Leaving the group will prevent the router from sending multicast - * datagrams to the local host, presuming no other process on the host is - * still joined to the group. - * - * @see https://developer.chrome.com/apps/sockets_udp#method-leaveGroup - * @param socketId The socket ID. - * @param address The group address to leave. Domain names are not - * supported. - * @param callback Called when the leaveGroup operation completes. - */ - export function leaveGroup(socketId: number, address: string, callback: (result: number) => void): void; - - /** - * Sets the time-to-live of multicast packets sent to the multicast group. - * - * Calling this method does not require multicast permissions. - * - * @see https://developer.chrome.com/apps/sockets_udp#method-setMulticastTimeToLive - * @param socketId The socket ID. - * @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; - - /** - * Sets whether multicast packets sent from the host to the multicast group - * will be looped back to the host. - * - * Note: the behavior of setMulticastLoopbackMode is slightly different - * between Windows and Unix-like systems. The inconsistency happens only - * 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 - * applications with loopback off will not SEND the loopback packets to - * other applications on the same host. - * @see MSDN: http://goo.gl/6vqbj - * - * Calling this method does not require multicast permissions. - * - * @see https://developer.chrome.com/apps/sockets_udp#method-setMulticastLoopbackMode - * @param socketId The socket ID. - * @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; - - /** - * Gets the multicast group addresses the socket is currently joined to. - * - * @see https://developer.chrome.com/apps/sockets_udp#method-getJoinedGroups - * @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; - - /** - * Enables or disables broadcast packets on this socket. - * - * @since Chrome 44 - * @see https://developer.chrome.com/apps/sockets_udp#method-setBroadcast - * @param socketId The socket ID. - * @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; - - /** - * 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>; - - /** - * Event raised when a network error occured while the runtime was waiting - * for data on the socket address and port. Once this event is raised, the - * socket is paused and no more onReceive events will be raised for this - * socket until the socket is resumed. - * - * @see https://developer.chrome.com/apps/sockets_udp#event-onReceiveError - */ - export var onReceiveError: chrome.events.Event<(args: ReceiveErrorEventArgs) => void>; -} - -/** - * Use the chrome.sockets.tcpServer API to create server applications using TCP - * connections. This API supersedes the TCP functionality previously found in - * the chrome.socket API. - * - * @since Chrome 33 - * @see https://developer.chrome.com/apps/sockets_tcpServer - */ -declare namespace chrome.sockets.tcpServer { - export interface CreateInfo { - socketId: number; - } - - export interface AcceptEventArgs { - socketId: number; - clientSocketId: number; - } - - export interface AcceptErrorEventArgs { - socketId: number; - resultCode: number; - } - - /** - * @see https://developer.chrome.com/apps/sockets_tcpServer#type-SocketProperties - */ - export 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 loaded, any sockets previously opened with - * persistent=true can be fetched with getSockets. - * - * @see http://developer.chrome.com/apps/app_lifecycle.html - */ - persistent?: boolean; - - /** An application-defined string associated with the socket. */ - name?: string; - } - - /** - * @see https://developer.chrome.com/apps/sockets_tcpServer#type-SocketInfo - */ - export interface SocketInfo { - /** The socket identifier. */ - socketId: number; - - /** - * 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; - - /** - * 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" - */ - paused: boolean; - - /** If the socket is listening, contains its local IPv4/6 address. */ - localAddress?: string; - - /** If the socket is listening, contains its local port. */ - localPort?: number; - } - - /** - * Creates a TCP server socket. - * - * @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; - - /** - * Creates a TCP server socket. - * - * @see https://developer.chrome.com/apps/sockets_tcpServer#method-create - * @param properties The socket properties. - * @param callback Called when the socket has been created. - */ - export function create(properties: SocketProperties, callback: (createInfo: CreateInfo) => void): void; - - /** - * Updates the socket properties. - * - * @see https://developer.chrome.com/apps/sockets_tcpServer#method-update - * @param socketId The socket identifier. - * @param properties The properties to update. - * @param callback Called when the properties are updated. - */ - export function update(socketId: number, properties: SocketProperties, callback?: () => void): void; - - /** - * Enables or disables a listening socket from accepting new connections. - * When paused, a listening socket accepts new connections until its backlog - * (see listen function) is full then refuses additional connection - * requests. onAccept events are raised only when the socket is un-paused. - * - * @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; - - /** - * Listens for connections on the specified port and address. If the - * port/address is in use, the callback indicates a failure. - * - * @see https://developer.chrome.com/apps/sockets_tcpServer#method-listen - * @param socketId The socket identifier. - * @param address The address of the local machine. - * @param port The port of the local machine. When set to 0, a free port - * is chosen dynamically. The dynamically allocated port can - * be found by calling getInfo. - * @param backlog Length of the socket's listen queue. The default value - * depends on the Operating System (SOMAXCONN), which - * 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; - - /** - * Listens for connections on the specified port and address. If the - * port/address is in use, the callback indicates a failure. - * - * @see https://developer.chrome.com/apps/sockets_tcpServer#method-listen - * @param socketId The socket identifier. - * @param address The address of the local machine. - * @param port The port of the local machine. When set to 0, a free port - * is chosen dynamically. The dynamically allocated port can - * 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; - - /** - * Disconnects the listening socket, i.e. stops accepting new connections - * and releases the address/port the socket is bound to. The socket - * identifier remains valid, e.g. it can be used with listen to accept - * connections on a new port and address. - * - * @see https://developer.chrome.com/apps/sockets_tcpServer#method-disconnect - * @param socketId The socket identifier. - * @param callback Called when the disconnect attempt is complete. - */ - export function disconnect(socketId: number, 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. - * - * @see https://developer.chrome.com/apps/sockets_tcpServer#method-close - * @param socketId The socket identifier. - * @param callback Called when the close operation completes. - */ - export function close(socketId: number, callback?: () => void): void; - - /** - * Retrieves the state of the given socket. - * - * @see https://developer.chrome.com/apps/sockets_tcpServer#method-getInfo - * @param socketId The socket identifier. - * @param callback Called when the socket state is available. - */ - export function getInfo(socketId: number, callback: (socketInfo: SocketInfo) => void): void; - - /** - * Retrieves the list of currently opened sockets owned by the application. - * - * @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; - - /** - * 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>; - - /** - * Event raised when a network error occured while the runtime was waiting - * for new connections on the socket address and port. Once this event is - * raised, the socket is set to paused and no more onAccept events are - * raised for this socket until the socket is resumed. - * - * @see https://developer.chrome.com/apps/sockets_tcpServer#event-onAcceptError - */ - export var onAcceptError: chrome.events.Event<(args: AcceptErrorEventArgs) => void>; -} - -//////////////////// -// System Display -//////////////////// -/** - * Use the system.display API to query display metadata. - * Permissions: "system.display" - * @since Chrome 30. - */ -declare namespace chrome.system.display { - export interface Bounds { - /** The x-coordinate of the upper-left corner. */ - left: number; - /** The y-coordinate of the upper-left corner. */ - top: number; - /** The width of the display in pixels. */ - width: number; - /** The height of the display in pixels. */ - height: number; - } - - export interface Insets { - /** The x-axis distance from the left bound. */ - left: number; - /** The y-axis distance from the top bound. */ - top: number; - /** The x-axis distance from the right bound. */ - right: number; - /** The y-axis distance from the bottom bound. */ - bottom: number; - } - - /** - * @since Chrome 57 - */ - export interface Point { - /** The x-coordinate of the point. */ - x: number; - /** The y-coordinate of the point. */ - y: number; - } - - /** - * @since Chrome 57 - */ - export interface TouchCalibrationPair { - /** The coordinates of the display point. */ - displayPoint: Point; - /** The coordinates of the touch point corresponding to the display point. */ - touchPoint: Point; - } - - /** - * @since Chrome 52 - */ - export interface DisplayMode { - /** The display mode width in device independent (user visible) pixels. */ - width: number; - - /** The display mode height in device independent (user visible) pixels. */ - height: number; - - /** The display mode width in native pixels. */ - widthInNativePixels: number; - - /** The display mode height in native pixels. */ - heightInNativePixels: number; - - /** The display mode UI scale factor. */ - uiScale: number; - - /** The display mode device scale factor. */ - deviceScaleFactor: number; - - /** True if the mode is the display's native mode. */ - isNative: boolean; - - /** True if the display mode is currently selected. */ - isSelected: boolean; - } - - /** - * @since Chrome 53 - */ - export interface DisplayLayout { - /** The unique identifier of the display. */ - id: string; - /** 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'; - /** 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. - * @export - * @interface TouchCalibrationPairs - */ - export interface TouchCalibrationPairs { - /** First pair of touch and display point required for touch calibration. */ - pair1: TouchCalibrationPair, - /** Second pair of touch and display point required for touch calibration. */ - pair2: TouchCalibrationPair, - /** Third pair of touch and display point required for touch calibration. */ - pair3: TouchCalibrationPair, - /** Fourth pair of touch and display point required for touch calibration. */ - pair4: TouchCalibrationPair - } - - /** - * @description Representation of info data to be used in chrome.system.display.setDisplayProperties() - * @export - * @interface DisplayPropertiesInfo - */ - export 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. - * @since Chrome 59 - * */ - isUnified?: boolean; - - /** - * Chrome OS only. If set and not empty, enables mirroring for this display. Otherwise disables mirroring for this display. This value should indicate the id of the source display to mirror, which must not be the same as the id passed to setDisplayProperties. If set, no other property may be set. - */ - mirroringSourceId?: string; - - /** If set to true, makes the display primary. No-op if set to false. */ - isPrimary?: boolean; - - /** If set, sets the display's overscan insets to the provided values. Note that overscan values may not be negative or larger than a half of the screen's size. Overscan cannot be changed on the internal monitor. It's applied after isPrimary parameter. */ - overscan?: Insets; - - /** If set, updates the display's rotation. Legal values are [0, 90, 180, 270]. The rotation is set clockwise, relative to the display's vertical position. It's applied after overscan paramter. */ - rotation?: 0 | 90 | 180 | 270; - - /** If set, updates the display's logical bounds origin along x-axis. Applied together with boundsOriginY, if boundsOriginY is set. Note that, when updating the display origin, some constraints will be applied, so the final bounds origin may be different than the one set. The final bounds can be retrieved using getInfo. The bounds origin is applied after rotation. The bounds origin cannot be changed on the primary display. Note that is also invalid to set bounds origin values if isPrimary is also set (as isPrimary parameter is applied first). */ - boundsOriginX?: number; - - /** If set, updates the display's logical bounds origin along y-axis. See documentation for boundsOriginX parameter. */ - boundsOriginY: number; - - /** - * @since Chrome 52 - * @description If set, updates the display mode to the mode matching this value. - */ - displayMode?: DisplayMode; - } - - /** - * @description Options affecting how the information is returned. - * @since Chrome 59 - * @export - * @interface DisplayInfoFlags - */ - export 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. - * @type {boolean} - * @memberof DisplayInfoFlags - */ - singleUnified?: boolean; - } - - /** Information about display properties. */ - export interface DisplayInfo { - /** The unique identifier of the display. */ - id: string; - /** 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; - /** True if this is the primary display. */ - isPrimary: boolean; - /** True if this is an internal display. */ - isInternal: boolean; - /** True if this display is enabled. */ - isEnabled: boolean; - /** The number of pixels per inch along the x-axis. */ - dpiX: number; - /** The number of pixels per inch along the y-axis. */ - dpiY: number; - /** The display's clockwise rotation in degrees relative to the vertical position. Currently exposed only on ChromeOS. Will be set to 0 on other platforms. */ - rotation: number; - /** The display's logical bounds. */ - bounds: Bounds; - /** The display's insets within its screen's bounds. Currently exposed only on ChromeOS. Will be set to empty insets on other platforms. */ - overscan: Insets; - /** The usable work area of the display within the display bounds. The work area excludes areas of the display reserved for OS, for example taskbar and launcher. */ - workArea: Bounds; - } - - /** 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|. */ - export interface DisplayProps { - /** If set and not empty, starts mirroring between this and the display with the provided id (the system will determine which of the displays is actually mirrored). If set and not empty, stops mirroring between this and the display with the specified id (if mirroring is in progress). If set, no other parameter may be set. */ - mirroringSourceId?: string; - /** If set to true, makes the display primary. No-op if set to false. */ - isPrimary?: boolean; - /** If set, sets the display's overscan insets to the provided values. Note that overscan values may not be negative or larger than a half of the screen's size. Overscan cannot be changed on the internal monitor. It's applied after isPrimary parameter. */ - overscan?: Insets; - /** If set, updates the display's rotation. Legal values are [0, 90, 180, 270]. The rotation is set clockwise, relative to the display's vertical position. It's applied after overscan paramter. */ - rotation?: number; - /** If set, updates the display's logical bounds origin along x-axis. Applied together with boundsOriginY, if boundsOriginY is set. Note that, when updating the display origin, some constraints will be applied, so the final bounds origin may be different than the one set. The final bounds can be retrieved using getInfo. The bounds origin is applied after rotation. The bounds origin cannot be changed on the primary display. Note that is also invalid to set bounds origin values if isPrimary is also set (as isPrimary parameter is applied first). */ - boundsOriginX?: number; - /** If set, updates the display's logical bounds origin along y-axis. See documentation for boundsOriginX parameter. */ - boundsOriginY?: number; - } - - /** - * @description Fired when anything changes to the display configuration. - * @export - * @interface DisplayChangedEvent - * @extends {chrome.events.Event<() => void>} - */ - export interface DisplayChangedEvent extends chrome.events.Event<() => void> { } - - /** - * @description 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; - /** - * @description 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; - - /** - * @description 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; - - /** - * @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. - * @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; - - /** - * @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. - * @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; - - /** - * @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. - * @since Chrome 46 - * @export - * @param {boolean} enabled True if unified desktop should be enabled. - */ - export 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. - * @since Chrome 53 - * @export - * @param {string} id The display's unique identifier. - */ - export 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. - * @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; - - /** - * @description 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; - - /** - * @description 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; - - /** - * @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. - * @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; - - /** - * @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. - * @since Chrome 57 - * @export - * @param {string} id The display's unique identifier. - */ - export 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. - * @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; - /** - * @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. - * @since Chrome 57 - * @export - * @param {string} id The display's unique identifier. - */ - export function clearTouchCalibration(id: string): void; - - /** - * @description Fired when anything changes to the display configuration. - * @export - */ - export var onDisplayChanged: DisplayChangedEvent; -} - -//////////////////// -// System - Network -//////////////////// -declare namespace chrome.system.network { - export interface NetworkInterface { - name: string; - address: string; - prefixLength: number; - } - - export function getNetworkInterfaces(callback: (networkInterfaces: NetworkInterface[]) => void): void; -} - -declare namespace chrome.runtime { - export interface Manifest { - app?: { - background?: { - scripts?: string[]; - } - }, - bluetooth?: { - uuids?: string[]; - socket?: boolean; - low_energy?: boolean; - peripheral?: boolean; - }, - file_handlers?: { - [name: string]: { - types?: string[]; - extensions?: string[]; - title?: string; - } - }, - kiosk_enabled?: boolean, - kiosk_only?: boolean, - url_handlers?: { - [name: string]: { - matches: string[]; - title?: string; - } - }, - usb_printers?: { - filters: { - vendorId?: number; - productId?: number; - interfaceClass?: number; - interfaceSubclass?: number; - interfaceProtocol?: number; - }[] - }, - webview?: { - partitions?: { - name: string; - accessible_resources: string[]; - }[] - } - } -} - -//////////////////// -// USB -//////////////////// -declare namespace chrome.usb { - type Direction = 'in' | 'out'; - - export interface Device { - device: number, - vendorId: number, - productId: number, - productName: string, - manufacturerName: string, - serialNumber: string - } - - export interface ConnectionHandle { - handle: number, - vendorId: number, - productId: number - } - - export interface EndpointDescriptor { - address: number, - type: 'control' | 'interrupt' | 'isochronous' | 'bulk', - direction: Direction, - maximumPacketSize: number, - synchronization?: 'asynchronous' | 'adaptive' | 'synchronous', - usage?: 'data' | 'feedback' | 'explicitFeedback', - pollingInterval?: number, - extra_data: ArrayBuffer - } - - export interface InterfaceDescriptor { - interfaceNumber: number, - alternateSetting: number, - interfaceClass: number, - interfaceSubclass: number, - interfaceProtocol: number, - description?: string, - endpoints: EndpointDescriptor[], - extra_data: ArrayBuffer - } - - export interface ConfigDescriptor { - active: boolean, - configurationValue: number, - description?: string, - selfPowered: boolean, - remoteWakeup: boolean, - maxPower: number, - interfaces: InterfaceDescriptor[], - extra_data: ArrayBuffer - } - - export interface GenericTransferInfo { - direction: Direction, - endpoint: number, - length?: number, - data?: ArrayBuffer, - timeout?: number - } - - export interface TransferResultInfo { - resultCode: number, - data?: ArrayBuffer - } - - export interface DeviceFilter { - vendorId?: number, - productId?: number, - interfaceClass?: number, - interfaceSubclass?: number, - interfaceProtocol?: number - } - - export interface TransferInfo { - direction: Direction; - recipient: 'device' | 'interface' | 'endpoint' | 'other'; - requestType: 'standard' | 'class' | 'vendor' | 'reserved'; - request: number; - value: number; - index: number; - length?: number; - data?: ArrayBuffer; - timeout?: number; - } - - export interface DeviceEvent extends chrome.events.Event<(device: Device) => void> { } - - export var onDeviceAdded: DeviceEvent; - export var 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; -} - -declare namespace chrome.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'; - export 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 - } - export interface ManagedLong { - /** - * @description The active value currently used by the network configuration manager (e.g. Shill). - * @type {number} - * @memberof ManagedLong - */ - Active?: number, - /** - * @description The source from which the effective property value was determined. - * @type {string} - * @memberof ManagedLong - */ - 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 - } -} diff --git a/types/chrome/chrome-cast.d.ts b/types/chrome/chrome-cast/index.d.ts similarity index 84% rename from types/chrome/chrome-cast.d.ts rename to types/chrome/chrome-cast/index.d.ts index 5c240ff25c..29bfbebf81 100644 --- a/types/chrome/chrome-cast.d.ts +++ b/types/chrome/chrome-cast/index.d.ts @@ -10,99 +10,102 @@ declare namespace chrome.cast { /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.AutoJoinPolicy + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.AutoJoinPolicy */ - export interface AutoJoinPolicy { - TAB_AND_ORIGIN_SCOPED: string; - ORIGIN_SCOPED: string; - PAGE_SCOPED: string; + export enum AutoJoinPolicy { + CUSTOM_CONTROLLER_SCOPED = "custom_controller_scoped", + TAB_AND_ORIGIN_SCOPED = "tab_and_origin_scoped", + ORIGIN_SCOPED = "origin_scoped", + PAGE_SCOPED = "page_scoped" } /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.DefaultActionPolicy + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.DefaultActionPolicy */ - export interface DefaultActionPolicy { - CREATE_SESSION: string; - CAST_THIS_TAB: string; + export enum DefaultActionPolicy { + CREATE_SESSION = "create_session", + CAST_THIS_TAB = "cast_this_tab" } /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Capability + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.Capability */ - export interface Capability { - VIDEO_OUT: string; - AUDIO_OUT: string; - VIDEO_IN: string; - AUDIO_IN: string; + export enum Capability { + VIDEO_OUT = "video_out", + AUDIO_OUT = "audio_out", + VIDEO_IN = "video_in", + AUDIO_IN = "audio_in", + MULTIZONE_GROUP = "multizone_group" } /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ErrorCode + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.ErrorCode */ - export interface ErrorCode { - CANCEL: string; - TIMEOUT: string; - API_NOT_INITIALIZED: string; - INVALID_PARAMETER: string; - EXTENSION_NOT_COMPATIBLE: string; - EXTENSION_MISSING: string; - RECEIVER_UNAVAILABLE: string; - SESSION_ERROR: string; - CHANNEL_ERROR: string; - LOAD_MEDIA_FAILED: string; + export enum ErrorCode { + CANCEL = "cancel", + TIMEOUT = "timeout", + API_NOT_INITIALIZED = "api_not_initialized", + INVALID_PARAMETER = "invalid_parameter", + EXTENSION_NOT_COMPATIBLE = "extension_not_compatible", + EXTENSION_MISSING = "extension_missing", + RECEIVER_UNAVAILABLE = "receiver_unavailable", + SESSION_ERROR = "session_error", + CHANNEL_ERROR = "channel_error", + LOAD_MEDIA_FAILED = "load_media_failed" } /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ReceiverAvailability + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.ReceiverAvailability */ - export interface ReceiverAvailability { - AVAILABLE: string; - UNAVAILABLE: string; + export enum ReceiverAvailability { + AVAILABLE = "available", + UNAVAILABLE = "unavailable" } /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.SenderPlatform + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.SenderPlatform */ - export interface SenderPlatform { - CHROME: string; - IOS: string; - ANDROID: string; + export enum SenderPlatform { + CHROME = "chrome", + IOS = "ios", + ANDROID = "android" } /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ReceiverType + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.ReceiverType */ - export interface ReceiverType { - CAST: string; - HANGOUT: string; - CUSTOM: string; + export enum ReceiverType { + CAST = "cast", + DIAL = "dial", + HANGOUT = "hangout", + CUSTOM = "custom" } /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ReceiverAction + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.ReceiverAction */ - export interface ReceiverAction { - CAST: string; - STOP: string; + export enum ReceiverAction { + CAST = "cast", + STOP = "stop" } /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.SessionStatus + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.SessionStatus */ - export interface SessionStatus { - CONNECTED: string; - DISCONNECTED: string; - STOPPED: string; + export enum SessionStatus { + CONNECTED = "connected", + DISCONNECTED = "disconnected", + STOPPED = "stopped" } /** @@ -208,7 +211,7 @@ declare namespace chrome.cast { receiverListener: (receiverAvailability: chrome.cast.ReceiverAvailability) => void, autoJoinPolicy?: chrome.cast.AutoJoinPolicy, defaultActionPolicy?: chrome.cast.DefaultActionPolicy - ):ApiConfig; + ): ApiConfig; sessionRequest: chrome.cast.SessionRequest; sessionListener: (session: chrome.cast.Session) => void; @@ -229,7 +232,7 @@ declare namespace chrome.cast { code: chrome.cast.ErrorCode, description?: string, details?: Object - ):Error; + ): Error; code: chrome.cast.ErrorCode; description?: string; @@ -237,15 +240,13 @@ declare namespace chrome.cast { } - export interface Image { + export class Image { /** * @param {string} url * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Image */ - new( - url: string - ):Image; + constructor(url: string); url: string; height?: number; @@ -260,7 +261,7 @@ declare namespace chrome.cast { */ new( platform: chrome.cast.SenderPlatform - ):SenderApplication; + ): SenderApplication; platform: chrome.cast.SenderPlatform; url?: string; @@ -279,7 +280,7 @@ declare namespace chrome.cast { appId: string, capabilities?: Array, timeout?: number - ):SessionRequest; + ): SessionRequest; appId: string; capabilities: Array; @@ -303,7 +304,7 @@ declare namespace chrome.cast { displayName: string, appImages: Array, receiver: chrome.cast.Receiver - ):Session; + ): Session; sessionId: string; appId: string; @@ -311,7 +312,7 @@ declare namespace chrome.cast { appImages: Array; receiver: chrome.cast.Receiver; senderApps: Array; - namespaces: Array<{name: string}>; + namespaces: Array<{ name: string }>; media: Array; status: chrome.cast.SessionStatus @@ -324,7 +325,7 @@ declare namespace chrome.cast { newLevel: number, successCallback: Function, errorCallback: (error: chrome.cast.Error) => void - ):void + ): void /** * @param {boolean} muted @@ -335,7 +336,7 @@ declare namespace chrome.cast { muted: boolean, successCallback: Function, errorCallback: (error: chrome.cast.Error) => void - ):void + ): void /** * @param {function()} successCallback @@ -344,7 +345,7 @@ declare namespace chrome.cast { leave( successCallback: Function, errorCallback: (error: chrome.cast.Error) => void - ):void + ): void /** * @param {function()} successCallback @@ -353,7 +354,7 @@ declare namespace chrome.cast { stop( successCallback: Function, errorCallback: (error: chrome.cast.Error) => void - ):void + ): void /** * @param {string} namespace @@ -366,21 +367,21 @@ declare namespace chrome.cast { message: string, successCallback: Function, errorCallback: (error: chrome.cast.Error) => void - ):void + ): void /** * @param {function(boolean)} listener */ addUpdateListener( - listener: (isAlive:boolean) => void - ):void + listener: (isAlive: boolean) => void + ): void /** * @param {function(boolean)} listener */ removeUpdateListener( - listener: (isAlive:boolean) => void - ):void + listener: (isAlive: boolean) => void + ): void /** * @param {string} namespace @@ -389,7 +390,7 @@ declare namespace chrome.cast { addMessageListener( namespace: string, listener: (namespace: string, message: string) => void - ):void + ): void /** * @param {string} namespace @@ -397,22 +398,22 @@ declare namespace chrome.cast { */ removeMessageListener( namespace: string, - listener: (namespace:string, message:string) => void - ):void + listener: (namespace: string, message: string) => void + ): void /** * @param {function(!chrome.cast.media.Media)} listener */ addMediaListener( listener: (media: chrome.cast.media.Media) => void - ):void + ): void /** * @param {function(!chrome.cast.media.Media)} listener */ removeMediaListener( listener: (media: chrome.cast.media.Media) => void - ):void + ): void /** * @param {!chrome.cast.media.LoadRequest} loadRequest @@ -423,7 +424,7 @@ declare namespace chrome.cast { loadRequest: chrome.cast.media.LoadRequest, successCallback: (media: chrome.cast.media.Media) => void, errorCallback: (error: chrome.cast.Error) => void - ):void + ): void /** * @param {!chrome.cast.media.QueueLoadRequest} queueLoadRequest @@ -434,7 +435,7 @@ declare namespace chrome.cast { queueLoadRequest: chrome.cast.media.QueueLoadRequest, successCallback: (media: chrome.cast.media.Media) => void, errorCallback: (error: chrome.cast.Error) => void - ):void + ): void } export interface Receiver { @@ -451,7 +452,7 @@ declare namespace chrome.cast { friendlyName: string, capabilities?: Array, volume?: chrome.cast.Volume - ):Receiver; + ): Receiver; label: string; friendlyName: string; @@ -471,7 +472,7 @@ declare namespace chrome.cast { new( statusText: string, appImages: Array - ):ReceiverDisplayStatus; + ): ReceiverDisplayStatus; statusText: string; appImages: Array; @@ -487,7 +488,7 @@ declare namespace chrome.cast { new( level?: number, muted?: boolean - ):Volume; + ): Volume; level?: number; muted?: boolean; @@ -500,77 +501,77 @@ declare namespace chrome.cast.media { /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MediaCommand + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.MediaCommand */ - export interface MediaCommand { - PAUSE: string; - SEEK: string; - STREAM_VOLUME: string; - STREAM_MUTE: string; + export enum MediaCommand { + PAUSE = "pause", + SEEK = "seek", + STREAM_VOLUME = "stream_volume", + STREAM_MUTE = "stream_mute" } /** * @enum {number} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MetadataType + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.MetadataType */ - export interface MetadataType { - GENERIC: number; - TV_SHOW: number; - MOVIE: number; - MUSIC_TRACK: number; - PHOTO: number; + export enum MetadataType { + GENERIC, + TV_SHOW, + MOVIE, + MUSIC_TRACK, + PHOTO } /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PlayerState + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.PlayerState */ - export interface PlayerState { - IDLE: string; - PLAYING: string; - PAUSED: string; - BUFFERING: string; + export enum PlayerState { + IDLE = "IDLE", + PLAYING = "PLAYING", + PAUSED = "PAUSED", + BUFFERING = "BUFFERING" } /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.ResumeState + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.ResumeState */ - export interface ResumeState { - PLAYBACK_START: string; - PLAYBACK_PAUSE: string; + export enum ResumeState { + PLAYBACK_START = "PLAYBACK_START", + PLAYBACK_PAUSE = "PLAYBACK_PAUSE" } /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.StreamType + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.StreamType */ - export interface StreamType { - BUFFERED: string; - LIVE: string; - OTHER: string; + export enum StreamType { + BUFFERED = "BUFFERED", + LIVE = "LIVE", + OTHER = "OTHER" } /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.IdleReason + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.IdleReason */ - export interface IdleReason { - CANCELLED: string; - INTERRUPTED: string; - FINISHED: string; - ERROR: string; + export enum IdleReason { + CANCELLED = "CANCELLED", + INTERRUPTED = "INTERRUPTED", + FINISHED = "FINISHED", + ERROR = "ERROR" } /** * @enum {string} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.RepeatMode */ - export interface RepeatMode { - OFF:string; - ALL:string; - SINGLE:string; - ALL_AND_SHUFFLE:string; + export enum RepeatMode { + OFF = "REPEAT_OFF", + ALL = "REPEAT_ALL", + SINGLE = "REPEAT_SINGLE", + ALL_AND_SHUFFLE = "REPEAT_ALL_AND_SHUFFLE" } export interface QueueItem { @@ -581,7 +582,7 @@ declare namespace chrome.cast.media { */ new( mediaInfo: chrome.cast.media.MediaInfo - ):QueueItem; + ): QueueItem; activeTrackIds: Array; autoplay: boolean; @@ -600,7 +601,7 @@ declare namespace chrome.cast.media { */ new( items: Array - ):QueueLoadRequest; + ): QueueLoadRequest; customData: Object; items: Array; @@ -616,10 +617,10 @@ declare namespace chrome.cast.media { */ new( itemsToInsert: Array - ):QueueInsertItemsRequest; + ): QueueInsertItemsRequest; customData: Object; - insertBefore:number; + insertBefore: number; items: Array; } @@ -631,7 +632,7 @@ declare namespace chrome.cast.media { */ new( itemIdsToRemove: Array - ):QueueRemoveItemsRequest; + ): QueueRemoveItemsRequest; customData: Object; itemIds: Array; @@ -645,7 +646,7 @@ declare namespace chrome.cast.media { */ new( itemIdsToReorder: Array - ):QueueReorderItemsRequest; + ): QueueReorderItemsRequest; customData: Object; insertBefore: number; @@ -660,7 +661,7 @@ declare namespace chrome.cast.media { */ new( itemsToUpdate: Array - ):QueueUpdateItemsRequest; + ): QueueUpdateItemsRequest; customData: Object; item: Array; @@ -668,71 +669,71 @@ declare namespace chrome.cast.media { /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TrackType + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TrackType */ - export interface TrackType { - TEXT: string; - AUDIO: string; - VIDEO: string; + export enum TrackType { + TEXT = "TEXT", + AUDIO = "AUDIO", + VIDEO = "VIDEO" } /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackType + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackType */ - export interface TextTrackType { - SUBTITLES: string; - CAPTIONS: string; - DESCRIPTIONS: string; - CHAPTERS: string; - METADATA: string; + export enum TextTrackType { + SUBTITLES = "SUBTITLES", + CAPTIONS = "CAPTIONS", + DESCRIPTIONS = "DESCRIPTIONS", + CHAPTERS = "CHAPTERS", + METADATA = "METADATA" } /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackEdgeType + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackEdgeType */ - export interface TextTrackEdgeType { - NONE: string; - OUTLINE: string; - DROP_SHADOW: string; - RAISED: string; - DEPRESSED: string; + export enum TextTrackEdgeType { + NONE = "NONE", + OUTLINE = "OUTLINE", + DROP_SHADOW = "DROP_SHADOW", + RAISED = "RAISED", + DEPRESSED = "DEPRESSED" } /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackWindowType + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackWindowType */ - export interface TextTrackWindowType { - NONE: string; - NORMAL: string; - ROUNDED_CORNERS: string; + export enum TextTrackWindowType { + NONE = "NONE", + NORMAL = "NORMAL", + ROUNDED_CORNERS = "ROUNDED_CORNERS" } /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackFontGenericFamily + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackFontGenericFamily */ - export interface TextTrackFontGenericFamily { - SANS_SERIF: string; - MONOSPACED_SANS_SERIF: string; - SERIF: string; - MONOSPACED_SERIF: string; - CASUAL: string; - CURSIVE: string; - SMALL_CAPITALS: string; + export enum TextTrackFontGenericFamily { + SANS_SERIF = "SANS_SERIF", + MONOSPACED_SANS_SERIF = "MONOSPACED_SANS_SERIF", + SERIF = "SERIF", + MONOSPACED_SERIF = "MONOSPACED_SERIF", + CASUAL = "CASUAL", + CURSIVE = "CURSIVE", + SMALL_CAPITALS = "SMALL_CAPITALS" } /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackFontStyle + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackFontStyle */ - export interface TextTrackFontStyle { - NORMAL: string; - BOLD: string; - BOLD_ITALIC: string; - ITALIC: string; + export enum TextTrackFontStyle { + NORMAL = "NORMAL", + BOLD = "BOLD", + BOLD_ITALIC = "BOLD_ITALIC", + ITALIC = "ITALIC" } export interface GetStatusRequest { @@ -740,7 +741,7 @@ declare namespace chrome.cast.media { * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.GetStatusRequest */ - new():GetStatusRequest; + new(): GetStatusRequest; customData: Object; } @@ -750,7 +751,7 @@ declare namespace chrome.cast.media { * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PauseRequest */ - new():PauseRequest; + new(): PauseRequest; customData: Object; } @@ -760,7 +761,7 @@ declare namespace chrome.cast.media { * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PlayRequest */ - new():PlayRequest; + new(): PlayRequest; customData: Object; } @@ -770,7 +771,7 @@ declare namespace chrome.cast.media { * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.SeekRequest */ - new():SeekRequest; + new(): SeekRequest; currentTime: number; resumeState: chrome.cast.media.ResumeState; @@ -782,7 +783,7 @@ declare namespace chrome.cast.media { * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.StopRequest */ - new():StopRequest; + new(): StopRequest; customData: Object; } @@ -795,21 +796,21 @@ declare namespace chrome.cast.media { */ new( volume: chrome.cast.Volume - ):VolumeRequest; + ): VolumeRequest; volume: chrome.cast.Volume; customData: Object; } - export interface LoadRequest { + export class LoadRequest { /** * @param {!chrome.cast.media.MediaInfo} mediaInfo * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.LoadRequest */ - new( + constructor( mediaInfo: chrome.cast.media.MediaInfo - ):LoadRequest; + ); activeTrackIds: Array; autoplay: boolean; @@ -828,19 +829,13 @@ declare namespace chrome.cast.media { new( activeTrackIds?: Array, textTrackStyle?: chrome.cast.media.TextTrackStyle - ):EditTracksInfoRequest; + ): EditTracksInfoRequest; activeTrackIds: Array; textTrackStyle: chrome.cast.media.TextTrackStyle; } - export interface GenericMediaMetadata { - /** - * @constructor - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.GenericMediaMetadata - */ - new():GenericMediaMetadata; - + export class GenericMediaMetadata { images: Array; metadataType: chrome.cast.media.MetadataType; releaseDate: string; @@ -857,7 +852,7 @@ declare namespace chrome.cast.media { * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MovieMediaMetadata */ - new():MovieMediaMetadata; + new(): MovieMediaMetadata; images: Array; metadataType: chrome.cast.media.MetadataType; @@ -898,7 +893,7 @@ declare namespace chrome.cast.media { releaseYear: number; } - export interface MusicTrackMediaMetadata { + export interface MusicTrackMediaMetadata { /** * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MusicTrackMediaMetadata @@ -947,17 +942,17 @@ declare namespace chrome.cast.media { type: chrome.cast.media.MetadataType; } - export interface MediaInfo { + export class MediaInfo { /** * @param {string} contentId * @param {string} contentType * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MediaInfo */ - new( + constructor( contentId: string, contentType: string - ): MediaInfo; + ); contentId: string; streamType: chrome.cast.media.StreamType; @@ -1089,14 +1084,14 @@ declare namespace chrome.cast.media { * @param {function(boolean)} listener */ addUpdateListener( - listener: (isAlive:boolean) => void + listener: (isAlive: boolean) => void ): void /** * @param {function(boolean)} listener */ removeUpdateListener( - listener: (isAlive:boolean) => void + listener: (isAlive: boolean) => void ): void /** @@ -1110,7 +1105,7 @@ declare namespace chrome.cast.media { * @param {function()} successCallback * @param {function(!chrome.cast.Error)} errorCallback */ - queueAppendItem ( + queueAppendItem( item: chrome.cast.media.QueueItem, successCallback: Function, errorCallback: (error: chrome.cast.Error) => void @@ -1121,7 +1116,7 @@ declare namespace chrome.cast.media { * @param {function()} successCallback * @param {function(!chrome.cast.Error)} errorCallback */ - queueInsertItems ( + queueInsertItems( queueInsertItemsRequest: chrome.cast.media.QueueInsertItemsRequest, successCallback: Function, errorCallback: (error: chrome.cast.Error) => void @@ -1132,7 +1127,7 @@ declare namespace chrome.cast.media { * @param {function()} successCallback * @param {function(!chrome.cast.Error)} errorCallback */ - queueJumpToItem ( + queueJumpToItem( itemId: number, successCallback: Function, errorCallback: (error: chrome.cast.Error) => void @@ -1144,7 +1139,7 @@ declare namespace chrome.cast.media { * @param {function()} successCallback * @param {function(!chrome.cast.Error)} errorCallback */ - queueMoveItemToNewIndex ( + queueMoveItemToNewIndex( itemId: number, newIndex: number, successCallback: Function, @@ -1155,7 +1150,7 @@ declare namespace chrome.cast.media { * @param {function()} successCallback * @param {function(!chrome.cast.Error)} errorCallback */ - queueNext ( + queueNext( successCallback: Function, errorCallback: (error: chrome.cast.Error) => void ): void @@ -1164,7 +1159,7 @@ declare namespace chrome.cast.media { * @param {function()} successCallback * @param {function(!chrome.cast.Error)} errorCallback */ - queuePrev ( + queuePrev( successCallback: Function, errorCallback: (error: chrome.cast.Error) => void ): void @@ -1174,7 +1169,7 @@ declare namespace chrome.cast.media { * @param {function()} successCallback * @param {function(!chrome.cast.Error)} errorCallback */ - queueRemoveItem ( + queueRemoveItem( itemId: number, successCallback: Function, errorCallback: (error: chrome.cast.Error) => void @@ -1185,7 +1180,7 @@ declare namespace chrome.cast.media { * @param {function()} successCallback * @param {function(!chrome.cast.Error)} errorCallback */ - queueReorderItems ( + queueReorderItems( queueReorderItemsRequest: chrome.cast.media.QueueReorderItemsRequest, successCallback: Function, errorCallback: (error: chrome.cast.Error) => void @@ -1196,7 +1191,7 @@ declare namespace chrome.cast.media { * @param {function()} successCallback * @param {function(!chrome.cast.Error)} errorCallback */ - queueSetRepeatMode ( + queueSetRepeatMode( repeatMode: chrome.cast.media.RepeatMode, successCallback: Function, errorCallback: (error: chrome.cast.Error) => void @@ -1207,7 +1202,7 @@ declare namespace chrome.cast.media { * @param {function()} successCallback * @param {function(!chrome.cast.Error)} errorCallback */ - queueUpdateItems ( + queueUpdateItems( queueUpdateItemsRequest: chrome.cast.media.QueueUpdateItemsRequest, successCallback: Function, errorCallback: (error: chrome.cast.Error) => void diff --git a/types/chrome/chrome-webview.d.ts b/types/chrome/chrome-webview.d.ts deleted file mode 100644 index e2e0b7c429..0000000000 --- a/types/chrome/chrome-webview.d.ts +++ /dev/null @@ -1,109 +0,0 @@ -/// - -// Project: http://developer.chrome.com/apps/ -// Definitions by: Nikolai Ommundsen -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 -// -// WebView ref: https://chromium.googlesource.com/chromium/src/+/64.0.3274.2/chrome/common/extensions/api/webview_tag.json -// - - -/////////////////// -// 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). - */ -declare namespace chrome.webviewTag { - /** Options that determine what data should be cleared by `clearData`. */ - export 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). */ - since: number; - } - export interface WindowEvent extends chrome.events.Event<() => void> {} - - export interface ConsoleEvent extends Event { - /** - * @description The severity level of the log message. Ranges from 0 to 4. - * @type {number} - * @memberof ConsoleEvent - */ - level: number, - /** - * @description The logged message contents. - * @type {string} - * @memberof ConsoleEvent - */ - message: string, - /** - * @description The line number of the message source. - * @type {number} - * @memberof ConsoleEvent - */ - line: number, - /** - * @description A string identifying the resource which logged the message. - * @type {string} - * @memberof ConsoleEvent - */ - sourceId: string - } - - /** Description of a declarative rule for handling events. */ - export interface Rule { - /** 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. */ - 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.¨ - * @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 - */ - export 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 - */ - code?: string, - /** - * @description JavaScript or CSS file to inject. - * @type {string} - * @memberof InjectDetails - */ - file?: string - } - - export interface WebViewElementEventMap extends ElementEventMap { - 'message': ConsoleEvent - } - - /** - * @description - * @export - * @interface HTMLWebViewElement - * @extends {Element} - */ - export interface HTMLWebViewElement extends Element { - executeScript?: (details: InjectDetails, callback?: (result: any) => void) => void, - src: string, - contentWindow: Window - addEventListener(type: K, listener: (this: HTMLWebViewElement, ev: WebViewElementEventMap[K]) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; - } -} diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index d2b92e4b22..0bfec6bfd8 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -135,7 +135,7 @@ declare namespace chrome.alarms { name: string; } - export interface AlarmEvent extends chrome.events.Event<(alarm: Alarm) => void> {} + export interface AlarmEvent extends chrome.events.Event<(alarm: Alarm) => 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. @@ -195,7 +195,9 @@ declare namespace chrome.alarms { export var onAlarm: AlarmEvent; } - +//////////////////// +// Browser +//////////////////// /** * Use the chrome.browser API to interact with the Chrome browser associated with * the current application and Chrome profile. @@ -282,19 +284,19 @@ declare namespace chrome.bookmarks { childIds: string[]; } - export interface BookmarkRemovedEvent extends chrome.events.Event<(id: string, removeInfo: BookmarkRemoveInfo) => void> {} + export interface BookmarkRemovedEvent extends chrome.events.Event<(id: string, removeInfo: BookmarkRemoveInfo) => void> { } - export interface BookmarkImportEndedEvent extends chrome.events.Event<() => void> {} + export interface BookmarkImportEndedEvent extends chrome.events.Event<() => void> { } - export interface BookmarkMovedEvent extends chrome.events.Event<(id: string, moveInfo: BookmarkMoveInfo) => void> {} + export interface BookmarkMovedEvent extends chrome.events.Event<(id: string, moveInfo: BookmarkMoveInfo) => void> { } - export interface BookmarkImportBeganEvent extends chrome.events.Event<() => void> {} + export interface BookmarkImportBeganEvent extends chrome.events.Event<() => void> { } - export interface BookmarkChangedEvent extends chrome.events.Event<(id: string, changeInfo: BookmarkChangeInfo) => void> {} + export interface BookmarkChangedEvent extends chrome.events.Event<(id: string, changeInfo: BookmarkChangeInfo) => void> { } - export interface BookmarkCreatedEvent extends chrome.events.Event<(id: string, bookmark: BookmarkTreeNode) => void> {} + export interface BookmarkCreatedEvent extends chrome.events.Event<(id: string, bookmark: BookmarkTreeNode) => void> { } - export interface BookmarkChildrenReordered extends chrome.events.Event<(id: string, reorderInfo: BookmarkReorderInfo) => void> {} + export interface BookmarkChildrenReordered extends chrome.events.Event<(id: string, reorderInfo: BookmarkReorderInfo) => void> { } export interface BookmarkSearchQuery { query?: string; @@ -480,7 +482,7 @@ declare namespace chrome.browserAction { popup: string; } - export interface BrowserClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {} + export interface BrowserClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> { } /** * Since Chrome 22. @@ -737,7 +739,7 @@ declare namespace chrome.commands { shortcut?: string; } - export interface CommandEvent extends chrome.events.Event<(command: string) => void> {} + export interface CommandEvent extends chrome.events.Event<(command: string) => void> { } /** * Returns all the registered extension commands for this extension and their shortcut (if active). @@ -1062,7 +1064,7 @@ declare namespace chrome.contextMenus { type?: string; } - export interface MenuClickedEvent extends chrome.events.Event<(info: OnClickData, tab?: chrome.tabs.Tab) => void> {} + export interface MenuClickedEvent extends chrome.events.Event<(info: OnClickData, tab?: chrome.tabs.Tab) => void> { } /** * Since Chrome 38. @@ -1223,7 +1225,7 @@ declare namespace chrome.cookies { cause: string; } - export interface CookieChangedEvent extends chrome.events.Event<(changeInfo: CookieChangeInfo) => void> {} + export interface CookieChangedEvent extends chrome.events.Event<(changeInfo: CookieChangeInfo) => void> { } /** * Lists all existing cookie stores. @@ -1327,9 +1329,9 @@ declare module chrome { faviconUrl?: string; } - export interface DebuggerDetachedEvent extends chrome.events.Event<(source: Debuggee, reason: string) => void> {} + export interface DebuggerDetachedEvent extends chrome.events.Event<(source: Debuggee, reason: string) => void> { } - export interface DebuggerEventEvent extends chrome.events.Event<(source: Debuggee, method: string, params?: Object) => void> {} + export interface DebuggerEventEvent extends chrome.events.Event<(source: Debuggee, method: string, params?: Object) => void> { } /** * Attaches debugger to the given target. @@ -1374,7 +1376,7 @@ declare module chrome { export var onEvent: DebuggerEventEvent; } - export {_debugger as debugger} + export { _debugger as debugger } } //////////////////// // Declarative Content @@ -1443,14 +1445,14 @@ declare namespace chrome.declarativeContent { /** Matches the state of a web page by various criteria. */ export class PageStateMatcher { - constructor(options: PageStateMatcherProperties); + constructor (options: PageStateMatcherProperties); } /** Declarative event action that shows the extension's page action while the corresponding conditions are met. */ - export class ShowPageAction {} + export class ShowPageAction { } /** Provides the Declarative Event API consisting of addRules, removeRules, and getRules. */ - export interface PageChangedEvent extends chrome.events.Event<() => void> {} + export interface PageChangedEvent extends chrome.events.Event<() => void> { } export var onPageChanged: PageChangedEvent; } @@ -1559,7 +1561,7 @@ declare namespace chrome.declarativeWebRequest { filter: RequestCookie; } - export interface RequestedEvent extends chrome.events.Event {} + export interface RequestedEvent extends chrome.events.Event { } export var onRequest: RequestedEvent; } @@ -1660,9 +1662,9 @@ declare namespace chrome.devtools.inspectedWindow { value: string; } - export interface ResourceAddedEvent extends chrome.events.Event<(resource: Resource) => void> {} + export interface ResourceAddedEvent extends chrome.events.Event<(resource: Resource) => void> { } - export interface ResourceContentCommittedEvent extends chrome.events.Event<(resource: Resource, content: string) => void> {} + export interface ResourceContentCommittedEvent extends chrome.events.Event<(resource: Resource, content: string) => void> { } /** The ID of the tab being inspected. This ID may be used with chrome.tabs.* API. */ export var tabId: number; @@ -1734,9 +1736,9 @@ declare namespace chrome.devtools.network { getContent(callback: (content: string, encoding: string) => void): void; } - export interface RequestFinishedEvent extends chrome.events.Event<(request: Request) => void> {} + export interface RequestFinishedEvent extends chrome.events.Event<(request: Request) => void> { } - export interface NavigatedEvent extends chrome.events.Event<(url: string) => void> {} + export interface NavigatedEvent extends chrome.events.Event<(url: string) => void> { } /** * Returns HAR log that contains all known network requests. @@ -1761,11 +1763,11 @@ declare namespace chrome.devtools.network { * Availability: Since Chrome 18. */ declare namespace chrome.devtools.panels { - export interface PanelShownEvent extends chrome.events.Event<(window: Window) => void> {} + export interface PanelShownEvent extends chrome.events.Event<(window: Window) => void> { } - export interface PanelHiddenEvent extends chrome.events.Event<() => void> {} + export interface PanelHiddenEvent extends chrome.events.Event<() => void> { } - export interface PanelSearchEvent extends chrome.events.Event<(action: string, queryString?: string) => void> {} + export interface PanelSearchEvent extends chrome.events.Event<(action: string, queryString?: string) => void> { } /** Represents a panel created by extension. */ export interface ExtensionPanel { @@ -1784,7 +1786,7 @@ declare namespace chrome.devtools.panels { onSearch: PanelSearchEvent; } - export interface ButtonClickedEvent extends chrome.events.Event<() => void> {} + export interface ButtonClickedEvent extends chrome.events.Event<() => void> { } /** A button created by the extension. */ export interface Button { @@ -1799,7 +1801,7 @@ declare namespace chrome.devtools.panels { onClicked: ButtonClickedEvent; } - export interface SelectionChangedEvent extends chrome.events.Event<() => void> {} + export interface SelectionChangedEvent extends chrome.events.Event<() => void> { } /** Represents the Elements panel. */ export interface ElementsPanel { @@ -1834,9 +1836,9 @@ declare namespace chrome.devtools.panels { onSelectionChanged: SelectionChangedEvent; } - export interface ExtensionSidebarPaneShownEvent extends chrome.events.Event<(window: chrome.windows.Window) => void> {} + export interface ExtensionSidebarPaneShownEvent extends chrome.events.Event<(window: chrome.windows.Window) => void> { } - export interface ExtensionSidebarPaneHiddenEvent extends chrome.events.Event<() => void> {} + export interface ExtensionSidebarPaneHiddenEvent extends chrome.events.Event<() => void> { } /** A sidebar created by the extension. */ export interface ExtensionSidebarPane { @@ -2152,13 +2154,13 @@ declare namespace chrome.downloads { conflictAction?: string; } - export interface DownloadChangedEvent extends chrome.events.Event<(downloadDelta: DownloadDelta) => void> {} + export interface DownloadChangedEvent extends chrome.events.Event<(downloadDelta: DownloadDelta) => void> { } - export interface DownloadCreatedEvent extends chrome.events.Event<(downloadItem: DownloadItem) => void> {} + export interface DownloadCreatedEvent extends chrome.events.Event<(downloadItem: DownloadItem) => void> { } - export interface DownloadErasedEvent extends chrome.events.Event<(downloadId: number) => void> {} + export interface DownloadErasedEvent extends chrome.events.Event<(downloadId: number) => void> { } - export interface DownloadDeterminingFilenameEvent extends chrome.events.Event<(downloadItem: DownloadItem, suggest: (suggestion?: DownloadFilenameSuggestion) => void) => void> {} + export interface DownloadDeterminingFilenameEvent extends chrome.events.Event<(downloadItem: DownloadItem, suggest: (suggestion?: DownloadFilenameSuggestion) => void) => void> { } /** * Find DownloadItem. Set query to the empty object to get all DownloadItem. To get a specific DownloadItem, set only the id field. To page through a large number of items, set orderBy: ['-startTime'], set limit to the number of items per page, and set startedAfter to the startTime of the last item from the last page. @@ -2507,7 +2509,7 @@ declare namespace chrome.extension { message: string; } - export interface OnRequestEvent extends chrome.events.Event<((request: any, sender: runtime.MessageSender, sendResponse: (response: any) => void) => void) | ((sender: runtime.MessageSender, sendResponse: (response: any) => void) => void)> {} + export interface OnRequestEvent extends chrome.events.Event<((request: any, sender: runtime.MessageSender, sendResponse: (response: any) => void) => void) | ((sender: runtime.MessageSender, sendResponse: (response: any) => void) => void)> { } /** * Since Chrome 7. @@ -2618,7 +2620,7 @@ declare namespace chrome.fileBrowserHandler { entries: any[]; } - export interface FileBrowserHandlerExecuteEvent extends chrome.events.Event<(id: string, details: FileHandlerExecuteEventDetails) => void> {} + export interface FileBrowserHandlerExecuteEvent extends chrome.events.Event<(id: string, details: FileHandlerExecuteEventDetails) => void> { } /** * Prompts user to select file path under which file should be saved. When the file is selected, file access permission required to use the file (read, write and create) are granted to the caller. The file will not actually get created during the function call, so function caller must ensure its existence before using it. The function has to be invoked with a user gesture. @@ -2864,33 +2866,33 @@ declare namespace chrome.fileSystemProvider { operationRequestId: number; } - export interface RequestedEvent extends chrome.events.Event<(options: RequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + export interface RequestedEvent extends chrome.events.Event<(options: RequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - export interface MetadataRequestedEvent extends chrome.events.Event<(options: MetadataRequestedEventOptions, successCallback: (metadata: EntryMetadata) => void, errorCallback: (error: string) => void) => void> {} + export interface MetadataRequestedEvent extends chrome.events.Event<(options: MetadataRequestedEventOptions, successCallback: (metadata: EntryMetadata) => void, errorCallback: (error: string) => void) => void> { } - export interface DirectoryPathRequestedEvent extends chrome.events.Event<(options: DirectoryPathRequestedEventOptions, successCallback: (entries: EntryMetadata[], hasMore: boolean) => void, errorCallback: (error: string) => void) => void> {} + export interface DirectoryPathRequestedEvent extends chrome.events.Event<(options: DirectoryPathRequestedEventOptions, successCallback: (entries: EntryMetadata[], hasMore: boolean) => void, errorCallback: (error: string) => void) => void> { } - export interface OpenFileRequestedEvent extends chrome.events.Event<(options: OpenFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + export interface OpenFileRequestedEvent extends chrome.events.Event<(options: OpenFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - export interface OpenedFileRequestedEvent extends chrome.events.Event<(options: OpenedFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + export interface OpenedFileRequestedEvent extends chrome.events.Event<(options: OpenedFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - export interface OpenedFileOffsetRequestedEvent extends chrome.events.Event<(options: OpenedFileOffsetRequestedEventOptions, successCallback: (data: ArrayBuffer, hasMore: boolean) => void, errorCallback: (error: string) => void) => void> {} + export interface OpenedFileOffsetRequestedEvent extends chrome.events.Event<(options: OpenedFileOffsetRequestedEventOptions, successCallback: (data: ArrayBuffer, hasMore: boolean) => void, errorCallback: (error: string) => void) => void> { } - export interface DirectoryPathRecursiveRequestedEvent extends chrome.events.Event<(options: DirectoryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + export interface DirectoryPathRecursiveRequestedEvent extends chrome.events.Event<(options: DirectoryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - export interface EntryPathRecursiveRequestedEvent extends chrome.events.Event<(options: EntryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + export interface EntryPathRecursiveRequestedEvent extends chrome.events.Event<(options: EntryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - export interface FilePathRequestedEvent extends chrome.events.Event<(options: FilePathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + export interface FilePathRequestedEvent extends chrome.events.Event<(options: FilePathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - export interface SourceTargetPathRequestedEvent extends chrome.events.Event<(options: SourceTargetPathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + export interface SourceTargetPathRequestedEvent extends chrome.events.Event<(options: SourceTargetPathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - export interface FilePathLengthRequestedEvent extends chrome.events.Event<(options: FilePathLengthRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + export interface FilePathLengthRequestedEvent extends chrome.events.Event<(options: FilePathLengthRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - export interface OpenedFileIoRequestedEvent extends chrome.events.Event<(options: OpenedFileIoRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + export interface OpenedFileIoRequestedEvent extends chrome.events.Event<(options: OpenedFileIoRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - export interface OperationRequestedEvent extends chrome.events.Event<(options: OperationRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {} + export interface OperationRequestedEvent extends chrome.events.Event<(options: OperationRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> { } - export interface OptionlessRequestedEvent extends chrome.events.Event<(successCallback: Function, errorCallback: (error: string) => void) => void> {} + export interface OptionlessRequestedEvent extends chrome.events.Event<(successCallback: Function, errorCallback: (error: string) => void) => void> { } /** * 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. @@ -3051,13 +3053,13 @@ declare namespace chrome.fontSettings { fontId: string; } - export interface DefaultFixedFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {} + export interface DefaultFixedFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> { } - export interface DefaultFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {} + export interface DefaultFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> { } - export interface MinimumFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {} + export interface MinimumFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> { } - export interface FontChangedEvent extends chrome.events.Event<(details: FullFontDetails) => void> {} + export interface FontChangedEvent extends chrome.events.Event<(details: FullFontDetails) => void> { } /** * Sets the default font size. @@ -3199,11 +3201,11 @@ declare namespace chrome.gcm { detail: Object; } - export interface MessageReceptionEvent extends chrome.events.Event<(message: IncomingMessage) => void> {} + export interface MessageReceptionEvent extends chrome.events.Event<(message: IncomingMessage) => void> { } - export interface MessageDeletionEvent extends chrome.events.Event<() => void> {} + export interface MessageDeletionEvent extends chrome.events.Event<() => void> { } - export interface GcmErrorEvent extends chrome.events.Event<(error: GcmError) => void> {} + export 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; @@ -3311,9 +3313,9 @@ declare namespace chrome.history { urls?: string[]; } - export interface HistoryVisitedEvent extends chrome.events.Event<(result: HistoryItem) => void> {} + export interface HistoryVisitedEvent extends chrome.events.Event<(result: HistoryItem) => void> { } - export interface HistoryVisitRemovedEvent extends chrome.events.Event<(removed: RemovedResult) => void> {} + export interface HistoryVisitRemovedEvent extends chrome.events.Event<(removed: RemovedResult) => void> { } /** * Searches the history for the last visit time of each page matching the query. @@ -3473,7 +3475,7 @@ declare namespace chrome.identity { interactive?: boolean; } - export interface SignInChangeEvent extends chrome.events.Event<(account: AccountInfo, signedIn: boolean) => void> {} + export interface SignInChangeEvent extends chrome.events.Event<(account: AccountInfo, signedIn: boolean) => void> { } /** * Retrieves a list of AccountInfo objects describing the accounts present on the profile. @@ -3540,7 +3542,7 @@ declare namespace chrome.identity { * @since Chrome 6. */ declare namespace chrome.idle { - export interface IdleStateChangedEvent extends chrome.events.Event<(newState: string) => void> {} + export interface IdleStateChangedEvent extends chrome.events.Event<(newState: string) => void> { } /** * 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. @@ -3829,25 +3831,25 @@ declare namespace chrome.input.ime { anchor: number; } - export interface BlurEvent extends chrome.events.Event<(contextID: number) => void> {} + export interface BlurEvent extends chrome.events.Event<(contextID: number) => void> { } - export interface CandidateClickedEvent extends chrome.events.Event<(engineID: string, candidateID: number, button: string) => void> {} + export interface CandidateClickedEvent extends chrome.events.Event<(engineID: string, candidateID: number, button: string) => void> { } - export interface KeyEventEvent extends chrome.events.Event<(engineID: string, keyData: KeyboardEvent) => void> {} + export interface KeyEventEvent extends chrome.events.Event<(engineID: string, keyData: KeyboardEvent) => void> { } - export interface DeactivatedEvent extends chrome.events.Event<(engineID: string) => void> {} + export interface DeactivatedEvent extends chrome.events.Event<(engineID: string) => void> { } - export interface InputContextUpdateEvent extends chrome.events.Event<(context: InputContext) => void> {} + export interface InputContextUpdateEvent extends chrome.events.Event<(context: InputContext) => void> { } - export interface ActivateEvent extends chrome.events.Event<(engineID: string, screen: string) => void> {} + export interface ActivateEvent extends chrome.events.Event<(engineID: string, screen: string) => void> { } - export interface FocusEvent extends chrome.events.Event<(context: InputContext) => void> {} + export interface FocusEvent extends chrome.events.Event<(context: InputContext) => void> { } - export interface MenuItemActivatedEvent extends chrome.events.Event<(engineID: string, name: string) => void> {} + export interface MenuItemActivatedEvent extends chrome.events.Event<(engineID: string, name: string) => void> { } - export interface SurroundingTextChangedEvent extends chrome.events.Event<(engineID: string, surroundingInfo: SurroundingTextInfo) => void> {} + export interface SurroundingTextChangedEvent extends chrome.events.Event<(engineID: string, surroundingInfo: SurroundingTextInfo) => void> { } - export interface InputResetEvent extends chrome.events.Event<(engineID: string) => void> {} + export interface InputResetEvent extends chrome.events.Event<(engineID: string) => void> { } /** * Adds the provided menu items to the language menu when this IME is active. @@ -4079,13 +4081,13 @@ declare namespace chrome.management { showConfirmDialog?: boolean; } - export interface ManagementDisabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {} + export interface ManagementDisabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> { } - export interface ManagementUninstalledEvent extends chrome.events.Event<(id: string) => void> {} + export interface ManagementUninstalledEvent extends chrome.events.Event<(id: string) => void> { } - export interface ManagementInstalledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {} + export interface ManagementInstalledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> { } - export interface ManagementEnabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> {} + export interface ManagementEnabledEvent extends chrome.events.Event<(info: ExtensionInfo) => void> { } /** * Enables or disables an app or extension. @@ -4232,7 +4234,7 @@ declare namespace chrome.networking.config { Security?: string; } - export interface CaptivePorttalDetectedEvent extends chrome.events.Event<(networkInfo: NetworkInfo) => void> {} + export interface CaptivePorttalDetectedEvent extends chrome.events.Event<(networkInfo: NetworkInfo) => void> { } /** * Allows an extension to define network filters for the networks it can handle. A call to this function will remove all filters previously installed by the extension before setting the new list. @@ -4337,15 +4339,15 @@ declare namespace chrome.notifications { requireInteraction?: boolean; } - export interface NotificationClosedEvent extends chrome.events.Event<(notificationId: string, byUser: boolean) => void> {} + export interface NotificationClosedEvent extends chrome.events.Event<(notificationId: string, byUser: boolean) => void> { } - export interface NotificationClickedEvent extends chrome.events.Event<(notificationId: string) => void> {} + export interface NotificationClickedEvent extends chrome.events.Event<(notificationId: string) => void> { } - export interface NotificationButtonClickedEvent extends chrome.events.Event<(notificationId: string, buttonIndex: number) => void> {} + export interface NotificationButtonClickedEvent extends chrome.events.Event<(notificationId: string, buttonIndex: number) => void> { } - export interface NotificationPermissionLevelChangedEvent extends chrome.events.Event<(level: string) => void> {} + export interface NotificationPermissionLevelChangedEvent extends chrome.events.Event<(level: string) => void> { } - export interface NotificationShowSettingsEvent extends chrome.events.Event<() => void> {} + export interface NotificationShowSettingsEvent extends chrome.events.Event<() => void> { } /** The notification closed, either by the system or by user action. */ export var onClosed: NotificationClosedEvent; @@ -4445,13 +4447,13 @@ declare namespace chrome.omnibox { description: string; } - export interface OmniboxInputEnteredEvent extends chrome.events.Event<(text: string) => void> {} + export interface OmniboxInputEnteredEvent extends chrome.events.Event<(text: string) => void> { } - export interface OmniboxInputChangedEvent extends chrome.events.Event<(text: string, suggest: (suggestResults: SuggestResult[]) => void) => void> {} + export interface OmniboxInputChangedEvent extends chrome.events.Event<(text: string, suggest: (suggestResults: SuggestResult[]) => void) => void> { } - export interface OmniboxInputStartedEvent extends chrome.events.Event<() => void> {} + export interface OmniboxInputStartedEvent extends chrome.events.Event<() => void> { } - export interface OmniboxInputCancelledEvent extends chrome.events.Event<() => void> {} + export interface OmniboxInputCancelledEvent extends chrome.events.Event<() => void> { } /** * Sets the description and styling for the default suggestion. The default suggestion is the text that is displayed in the first suggestion row underneath the URL bar. @@ -4478,7 +4480,7 @@ declare namespace chrome.omnibox { * @since Chrome 5. */ declare namespace chrome.pageAction { - export interface PageActionClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {} + export interface PageActionClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> { } export interface TitleDetails { /** The id of the tab for which you want to modify the page action. */ @@ -4787,13 +4789,13 @@ declare namespace chrome.printerProvider { document: Blob; } - export interface PrinterRequestedEvent extends chrome.events.Event<(resultCallback: (printerInfo: PrinterInfo[]) => void) => void> {} + export interface PrinterRequestedEvent extends chrome.events.Event<(resultCallback: (printerInfo: PrinterInfo[]) => void) => void> { } - export interface PrinterInfoRequestedEvent extends chrome.events.Event<(device: any, resultCallback: (printerInfo?: PrinterInfo) => void) => void> {} + export interface PrinterInfoRequestedEvent extends chrome.events.Event<(device: any, resultCallback: (printerInfo?: PrinterInfo) => void) => void> { } - export interface CapabilityRequestedEvent extends chrome.events.Event<(printerId: string, resultCallback: (capabilities: PrinterCapabilities) => void) => void> {} + export interface CapabilityRequestedEvent extends chrome.events.Event<(printerId: string, resultCallback: (capabilities: PrinterCapabilities) => void) => void> { } - export interface PrintRequestedEvent extends chrome.events.Event<(printJob: PrintJob, resultCallback: (result: string) => void) => void> {} + export 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; @@ -4930,7 +4932,7 @@ declare namespace chrome.proxy { fatal: boolean; } - export interface ProxyErrorEvent extends chrome.events.Event<(details: ErrorDetails) => void> {} + export interface ProxyErrorEvent extends chrome.events.Event<(details: ErrorDetails) => void> { } export var settings: chrome.types.ChromeSetting; /** Notifies about proxy errors. */ @@ -5060,21 +5062,21 @@ declare namespace chrome.runtime { version: string; } - export interface PortDisconnectEvent extends chrome.events.Event<(port: Port) => void> {} + export interface PortDisconnectEvent extends chrome.events.Event<(port: Port) => void> { } - export interface PortMessageEvent extends chrome.events.Event<(message: any, port: Port) => void> {} + export interface PortMessageEvent extends chrome.events.Event<(message: any, port: Port) => void> { } - export interface ExtensionMessageEvent extends chrome.events.Event<(message: any, sender: MessageSender, sendResponse: (response: any) => void) => void> {} + export interface ExtensionMessageEvent extends chrome.events.Event<(message: any, sender: MessageSender, sendResponse: (response: any) => void) => void> { } - export interface ExtensionConnectEvent extends chrome.events.Event<(port: Port) => void> {} + export interface ExtensionConnectEvent extends chrome.events.Event<(port: Port) => void> { } - export interface RuntimeInstalledEvent extends chrome.events.Event<(details: InstalledDetails) => void> {} + export interface RuntimeInstalledEvent extends chrome.events.Event<(details: InstalledDetails) => void> { } - export interface RuntimeEvent extends chrome.events.Event<() => void> {} + export interface RuntimeEvent extends chrome.events.Event<() => void> { } - export interface RuntimeRestartRequiredEvent extends chrome.events.Event<(reason: string) => void> {} + export interface RuntimeRestartRequiredEvent extends chrome.events.Event<(reason: string) => void> { } - export interface RuntimeUpdateAvailableEvent extends chrome.events.Event<(details: UpdateAvailableDetails) => void> {} + export interface RuntimeUpdateAvailableEvent extends chrome.events.Event<(details: UpdateAvailableDetails) => void> { } export interface ManifestIcons { [size: number]: string; @@ -5462,7 +5464,7 @@ declare namespace chrome.scriptBadge { popup: string; } - export interface ScriptBadgeClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {} + export interface ScriptBadgeClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> { } export function getPopup(details: GetPopupDetails, callback: Function): void; export function getAttention(details: AttentionDetails): void; @@ -5510,7 +5512,7 @@ declare namespace chrome.sessions { sessions: Session[]; } - export interface SessionChangedEvent extends chrome.events.Event<() => void> {} + export interface SessionChangedEvent extends chrome.events.Event<() => void> { } /** The maximum number of sessions.Session that will be included in a requested list. */ export var MAX_SESSION_RESULTS: number; @@ -5646,7 +5648,7 @@ declare namespace chrome.storage { MAX_WRITE_OPERATIONS_PER_MINUTE: number; } - export interface StorageChangedEvent extends chrome.events.Event<(changes: { [key: string]: StorageChange }, areaName: string) => void> {} + export 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; @@ -5820,9 +5822,9 @@ declare namespace chrome.system.storage { availableCapacity: number; } - export interface SystemStorageAttachedEvent extends chrome.events.Event<(info: StorageUnitInfo) => void> {} + export interface SystemStorageAttachedEvent extends chrome.events.Event<(info: StorageUnitInfo) => void> { } - export interface SystemStorageDetachedEvent extends chrome.events.Event<(id: string) => void> {} + export 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; @@ -5876,7 +5878,7 @@ declare namespace chrome.tabCapture { videoConstraints?: MediaStreamConstraints; } - export interface CaptureStatusChangedEvent extends chrome.events.Event<(info: CaptureInfo) => void> {} + export interface CaptureStatusChangedEvent extends chrome.events.Event<(info: CaptureInfo) => void> { } /** * Captures the visible area of the currently active tab. Capture can only be started on the currently active tab after the extension has been invoked. Capture is maintained across page navigations within the tab, and stops when the tab is closed, or the media stream is closed by the extension. @@ -5989,6 +5991,16 @@ declare namespace chrome.tabs { * @since Chrome 45. */ audible?: boolean; + /** + * Whether the tab is discarded. A discarded tab is one whose content has been unloaded from memory, but is still visible in the tab strip. Its content gets reloaded the next time it's activated. + * @since Chrome 54. + */ + discarded: boolean; + /** + * Whether the tab can be discarded automatically by the browser when resources are low. + * @since Chrome 54. + */ + autoDiscardable: boolean; /** * Optional. * Current tab muted state and the reason for the last state change. @@ -6153,6 +6165,11 @@ declare namespace chrome.tabs { * @since Chrome 45. */ muted?: boolean; + /** + * Optional. Whether the tab should be discarded automatically by the browser when resources are low. + * @since Chrome 54. + */ + autoDiscardable?: boolean; } export interface CaptureVisibleTabOptions { @@ -6200,7 +6217,7 @@ declare namespace chrome.tabs { * Optional. Whether the tabs have completed loading. * One of: "loading", or "complete" */ - status?: string; + status?: 'loading' | 'complete'; /** * Optional. Whether the tabs are in the last focused window. * @since Chrome 19. @@ -6212,7 +6229,7 @@ declare namespace chrome.tabs { * Optional. The type of window the tabs are in. * One of: "normal", "popup", "panel", "app", or "devtools" */ - windowType?: string; + windowType?: 'normal' | 'popup' | 'panel' | 'app' | 'devtools'; /** Optional. Whether the tabs are active in their windows. */ active?: boolean; /** @@ -6231,6 +6248,18 @@ declare namespace chrome.tabs { currentWindow?: boolean; /** Optional. Whether the tabs are highlighted. */ highlighted?: boolean; + /** + * Optional. + * Whether the tabs are discarded. A discarded tab is one whose content has been unloaded from memory, but is still visible in the tab strip. Its content gets reloaded the next time it's activated. + * @since Chrome 54. + */ + discarded?: boolean; + /** + * Optional. + * Whether the tabs can be discarded automatically by the browser when resources are low. + * @since Chrome 54. + */ + autoDiscardable?: boolean; /** Optional. Whether the tabs are pinned. */ pinned?: boolean; /** @@ -6280,6 +6309,16 @@ declare namespace chrome.tabs { * @since Chrome 45. */ audible?: boolean; + /** + * The tab's new discarded state. + * @since Chrome 54. + */ + discarded?: boolean; + /** + * The tab's new auto-discardable + * @since Chrome 54. + */ + autoDiscardable?: boolean; /** * The tab's new muted state and the reason for the change. * @since Chrome 46. Warning: this is the current Beta channel. @@ -6327,27 +6366,27 @@ declare namespace chrome.tabs { zoomSettings: ZoomSettings; } - export interface TabHighlightedEvent extends chrome.events.Event<(highlightInfo: HighlightInfo) => void> {} + export interface TabHighlightedEvent extends chrome.events.Event<(highlightInfo: HighlightInfo) => void> { } - export interface TabRemovedEvent extends chrome.events.Event<(tabId: number, removeInfo: TabRemoveInfo) => void> {} + export interface TabRemovedEvent extends chrome.events.Event<(tabId: number, removeInfo: TabRemoveInfo) => void> { } - export interface TabUpdatedEvent extends chrome.events.Event<(tabId: number, changeInfo: TabChangeInfo, tab: Tab) => void> {} + export interface TabUpdatedEvent extends chrome.events.Event<(tabId: number, changeInfo: TabChangeInfo, tab: Tab) => void> { } - export interface TabAttachedEvent extends chrome.events.Event<(tabId: number, attachInfo: TabAttachInfo) => void> {} + export interface TabAttachedEvent extends chrome.events.Event<(tabId: number, attachInfo: TabAttachInfo) => void> { } - export interface TabMovedEvent extends chrome.events.Event<(tabId: number, moveInfo: TabMoveInfo) => void> {} + export interface TabMovedEvent extends chrome.events.Event<(tabId: number, moveInfo: TabMoveInfo) => void> { } - export interface TabDetachedEvent extends chrome.events.Event<(tabId: number, detachInfo: TabDetachInfo) => void> {} + export interface TabDetachedEvent extends chrome.events.Event<(tabId: number, detachInfo: TabDetachInfo) => void> { } - export interface TabCreatedEvent extends chrome.events.Event<(tab: Tab) => void> {} + export interface TabCreatedEvent extends chrome.events.Event<(tab: Tab) => void> { } - export interface TabActivatedEvent extends chrome.events.Event<(activeInfo: TabActiveInfo) => void> {} + export interface TabActivatedEvent extends chrome.events.Event<(activeInfo: TabActiveInfo) => void> { } - export interface TabReplacedEvent extends chrome.events.Event<(addedTabId: number, removedTabId: number) => void> {} + export interface TabReplacedEvent extends chrome.events.Event<(addedTabId: number, removedTabId: number) => void> { } - export interface TabSelectedEvent extends chrome.events.Event<(tabId: number, selectInfo: TabWindowInfo) => void> {} + export interface TabSelectedEvent extends chrome.events.Event<(tabId: number, selectInfo: TabWindowInfo) => void> { } - export interface TabZoomChangeEvent extends chrome.events.Event<(ZoomChangeInfo: ZoomChangeInfo) => void> {} + export interface TabZoomChangeEvent extends chrome.events.Event<(ZoomChangeInfo: ZoomChangeInfo) => void> { } /** * Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc. @@ -6604,6 +6643,13 @@ declare namespace chrome.tabs { * Paramater zoomSettings: The tab's current zoom settings. */ export function getZoomSettings(tabId: number, callback: (zoomSettings: ZoomSettings) => void): void; + /** + * Discards a tab from memory. Discarded tabs are still visible on the tab strip and are reloaded when activated. + * @since Chrome 54. + * @param tabId Optional. The ID of the tab to be discarded. If specified, the tab will be discarded unless it's active or already discarded. If omitted, the browser will discard the least important tab. This can fail if no discardable tabs exist. + * @param callback Called after the operation is completed. + */ + export function discard(tabId: number, callback: (tab: Tab) => void): void; /** * Fired when the highlighted or selected tabs in a window changes. @@ -6828,7 +6874,7 @@ declare namespace chrome.ttsEngine { pitch?: number; } - export interface TtsEngineSpeakEvent extends chrome.events.Event<(utterance: string, options: SpeakOptions, sendTtsEvent: (event: chrome.tts.TtsEvent) => void) => void> {} + export interface TtsEngineSpeakEvent extends chrome.events.Event<(utterance: string, options: SpeakOptions, sendTtsEvent: (event: chrome.tts.TtsEvent) => void) => void> { } /** Called when the user makes a call to tts.speak() and one of the voices from this extension's manifest is the first to match the options object. */ export var onSpeak: TtsEngineSpeakEvent; @@ -6912,7 +6958,7 @@ declare namespace chrome.types { incognitoSpecific?: boolean; } - export interface ChromeSettingChangedEvent extends chrome.events.Event {} + export interface ChromeSettingChangedEvent extends chrome.events.Event { } /** An interface that allows access to a Chrome browser setting. See accessibilityFeatures for an example. */ export interface ChromeSetting { @@ -6969,15 +7015,15 @@ declare namespace chrome.vpnProvider { dnsServer: string[]; } - export interface VpnPlatformMessageEvent extends chrome.events.Event<(id: string, message: string, error: string) => void> {} + export interface VpnPlatformMessageEvent extends chrome.events.Event<(id: string, message: string, error: string) => void> { } - export interface VpnPacketReceptionEvent extends chrome.events.Event<(data: ArrayBuffer) => void> {} + export interface VpnPacketReceptionEvent extends chrome.events.Event<(data: ArrayBuffer) => void> { } - export interface VpnConfigRemovalEvent extends chrome.events.Event<(id: string) => void> {} + export interface VpnConfigRemovalEvent extends chrome.events.Event<(id: string) => void> { } - export interface VpnConfigCreationEvent extends chrome.events.Event<(id: string, name: string, data: Object) => void> {} + export interface VpnConfigCreationEvent extends chrome.events.Event<(id: string, name: string, data: Object) => void> { } - export interface VpnUiEvent extends chrome.events.Event<(event: string, id?: string) => void> {} + export interface VpnUiEvent extends chrome.events.Event<(event: string, id?: string) => void> { } /** * Creates a new VPN configuration that persists across multiple login sessions of the user. @@ -7175,17 +7221,17 @@ declare namespace chrome.webNavigation { addListener(callback: (details: T) => void, filters?: WebNavigationEventFilter): void; } - export interface WebNavigationFramedEvent extends WebNavigationEvent {} + export interface WebNavigationFramedEvent extends WebNavigationEvent { } - export interface WebNavigationFramedErrorEvent extends WebNavigationEvent {} + export interface WebNavigationFramedErrorEvent extends WebNavigationEvent { } - export interface WebNavigationSourceEvent extends WebNavigationEvent {} + export interface WebNavigationSourceEvent extends WebNavigationEvent { } - export interface WebNavigationParentedEvent extends WebNavigationEvent {} + export interface WebNavigationParentedEvent extends WebNavigationEvent { } - export interface WebNavigationTransitionalEvent extends WebNavigationEvent {} + export interface WebNavigationTransitionalEvent extends WebNavigationEvent { } - export interface WebNavigationReplacementEvent extends WebNavigationEvent {} + export interface WebNavigationReplacementEvent extends WebNavigationEvent { } /** * Retrieves information about the given frame. A frame refers to an